-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
None
-
Affects Version/s: None
-
None
-
Environment:
Minecraft Version: 1.21.6
Minecraft Version ID: 1.21.6
Operating System: Windows 10 (amd64) version 10.0
Java Version: 21.0.7, Microsoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
Memory: 381742376 bytes (364 MiB) / 771751936 bytes (736 MiB) up to 2147483648 bytes (2048 MiB)
CPUs: 4
Processor Vendor: GenuineIntel
Processor Name: Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
Identifier: Intel64 Family 6 Model 158 Stepping 9
Microarchitecture: Kaby Lake
Frequency (GHz): 3.00
Number of physical packages: 1
Number of physical CPUs: 4
Number of logical CPUs: 4
Graphics card #0 name: NVIDIA GeForce GTX 1050
Graphics card #0 vendor: NVIDIA
Graphics card #0 VRAM (MiB): 2048.00
Graphics card #0 deviceId: VideoController1
Graphics card #0 versionInfo: 32.0.15.6094
Graphics card #1 name: Intel(R) HD Graphics 630
Graphics card #1 vendor: Intel Corporation
Graphics card #1 VRAM (MiB): 1024.00
Graphics card #1 deviceId: VideoController2
Graphics card #1 versionInfo: 27.20.100.8280
Graphics card #2 name: Microsoft Basic Display Adapter
Graphics card #2 vendor: Microsoft
Graphics card #2 VRAM (MiB): 0.00
Graphics card #2 deviceId: VideoController3
Graphics card #2 versionInfo: 10.0.19041.3636
Memory slot #0 capacity (MiB): 8192.00
Memory slot #0 clockSpeed (GHz): 2.40
Memory slot #0 type: DDR4
Memory slot #1 capacity (MiB): 8192.00
Memory slot #1 clockSpeed (GHz): 2.40
Memory slot #1 type: DDR4
Virtual memory max (MiB): 29522.52
Virtual memory used (MiB): 20342.34
Swap memory total (MiB): 13179.82
Swap memory used (MiB): 0.00
Space in storage for jna.tmpdir (MiB): available: 17551.70, total: 456717.03
Space in storage for org.lwjgl.system.SharedLibraryExtractPath (MiB): available: 17551.70, total: 456717.03
Space in storage for io.netty.native.workdir (MiB): available: 17551.70, total: 456717.03
Space in storage for java.io.tmpdir (MiB): available: 17551.70, total: 456717.03
Space in storage for workdir (MiB): available: 17551.70, total: 456717.03
JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32MMinecraft Version: 1.21.6 Minecraft Version ID: 1.21.6 Operating System: Windows 10 (amd64) version 10.0 Java Version: 21.0.7, Microsoft Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft Memory: 381742376 bytes (364 MiB) / 771751936 bytes (736 MiB) up to 2147483648 bytes (2048 MiB) CPUs: 4 Processor Vendor: GenuineIntel Processor Name: Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz Identifier: Intel64 Family 6 Model 158 Stepping 9 Microarchitecture: Kaby Lake Frequency (GHz): 3.00 Number of physical packages: 1 Number of physical CPUs: 4 Number of logical CPUs: 4 Graphics card #0 name: NVIDIA GeForce GTX 1050 Graphics card #0 vendor: NVIDIA Graphics card #0 VRAM (MiB): 2048.00 Graphics card #0 deviceId: VideoController1 Graphics card #0 versionInfo: 32.0.15.6094 Graphics card #1 name: Intel(R) HD Graphics 630 Graphics card #1 vendor: Intel Corporation Graphics card #1 VRAM (MiB): 1024.00 Graphics card #1 deviceId: VideoController2 Graphics card #1 versionInfo: 27.20.100.8280 Graphics card #2 name: Microsoft Basic Display Adapter Graphics card #2 vendor: Microsoft Graphics card #2 VRAM (MiB): 0.00 Graphics card #2 deviceId: VideoController3 Graphics card #2 versionInfo: 10.0.19041.3636 Memory slot #0 capacity (MiB): 8192.00 Memory slot #0 clockSpeed (GHz): 2.40 Memory slot #0 type: DDR4 Memory slot #1 capacity (MiB): 8192.00 Memory slot #1 clockSpeed (GHz): 2.40 Memory slot #1 type: DDR4 Virtual memory max (MiB): 29522.52 Virtual memory used (MiB): 20342.34 Swap memory total (MiB): 13179.82 Swap memory used (MiB): 0.00 Space in storage for jna.tmpdir (MiB): available: 17551.70, total: 456717.03 Space in storage for org.lwjgl.system.SharedLibraryExtractPath (MiB): available: 17551.70, total: 456717.03 Space in storage for io.netty.native.workdir (MiB): available: 17551.70, total: 456717.03 Space in storage for java.io.tmpdir (MiB): available: 17551.70, total: 456717.03 Space in storage for workdir (MiB): available: 17551.70, total: 456717.03 JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
-
4509-Spigot-d5ca3f8-58bf15a (MC: 1.21.6) (Implementing API version 1.21.6-R0.1-SNAPSHOT)
-
Yes
When using Player#getInventory().setHelmet(ItemStack) or Player#getInventory().setItem(EquipmentSlot.HEAD, ItemStack), the player is immediately disconnected from the server with the following error:
Failed to handle packet adm@282ed343, disconnecting
java.lang.IndexOutOfBoundsException: Index 46 out of bounds for length 46
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
at java.base/java.util.Objects.checkIndex(Objects.java:385)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
... (stack trace continues)
This issue does not occur when setting the helmet using the raw inventory index 39, for example:
player.getInventory().setItem(39, new ItemStack(Material.DIAMOND_HELMET));
But the following lines cause the player to disconnect:
player.getInventory().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
player.getInventory().setItem(EquipmentSlot.HEAD, new ItemStack(Material.DIAMOND_HELMET));
It also happens when setting an item in an ItemDisplay