Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2220

Bukkit.CreateInventory(null, Inventory.ANVIL) spam exception when clicking.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • None
    • Windows 10, Java 8

      The following code is used when creating this issue:

      Inventory inventory = Bukkit.createInventory(null, InventoryType.ANVIL);
      player.openInventory(inventory);
      

      The created anvil works fine except whenever clicked on any slot in the open GUI, an IndexOutOfBoundsException is thrown, which size is always 0.

      [13:05:30 FATAL]: Error executing task
      java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 2, Size: 0
              at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_74]
              at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_74]
              at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:46) [spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:721) [spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at java.lang.Thread.run(Unknown Source) [?:1.8.0_74]
      Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 0
              at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_74]
              at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_74]
              at net.minecraft.server.v1_9_R1.Container.getSlot(Container.java:109) ~[spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:1678) ~[spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at net.minecraft.server.v1_9_R1.PacketPlayInWindowClick.a(SourceFile:33) ~[spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at net.minecraft.server.v1_9_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) ~[spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_74]
              at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_74]
              at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) ~[spigot-1.9.2.jar:git-Spigot-e6f93f4-22dcde5]
              ... 5 more
      

            Unassigned Unassigned
            Hu Fanghan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: