Container duplicate bug
knokko opened this issue ยท 3 comments
Someone managed to encounter the following exception:
[09:30:31 ERROR]: Could not pass event InventoryClickEvent to CustomItems v8.1 org.bukkit.event.EventException: null at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1891) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at net.minecraft.server.v1_12_R1.PacketPlayInWindowClick.a(SourceFile:33) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at net.minecraft.server.v1_12_R1.PacketPlayInWindowClick.a(SourceFile:10) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: java.lang.IndexOutOfBoundsException: Index 90 out of bounds for length 90 at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?] at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?] at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) ~[?:?] at java.util.Objects.checkIndex(Objects.java:372) ~[?:?] at java.util.ArrayList.get(ArrayList.java:459) ~[?:?] at net.minecraft.server.v1_12_R1.Container.getSlot(Container.java:110) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventoryView.getItem(CraftInventoryView.java:65) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] at nl.knokko.customitems.plugin.CustomItemsEventHandler.onInventoryClick(CustomItemsEventHandler.java:2036) ~[?:?] at jdk.internal.reflect.GeneratedMethodAccessor115.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34] ... 15 more
According to the reporter, this happens when left-dragging a custom item to the output slot of the container.
I managed to reproduce the duplicate glitch, but not the exception shown above. I will wait for the reporter of the bug to show how he managed to cause this.
He gave us some very useful information: he posted his .cis file on the discord, and told us that we need to use minecraft 1.12.2 and drag an item from the input slot of this container to the output slot.
The bug itself is fixed, see #55 for some unrelated problems that were found today.