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

Creating an inventory with type SHULKER_BOX has issues

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None

      The inventory opens, with the title. However no items were added. Clicking the empty spaces throws this error:

      [00:55:09 FATAL]: Error executing task
      java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_101]
      	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_101]
      	at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:47) [spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:747) [spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678) [spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576) [spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
      Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_101]
      	at java.util.ArrayList.get(ArrayList.java:429) ~[?:1.8.0_101]
      	at net.minecraft.server.v1_11_R1.Container.getSlot(Container.java:110) ~[spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1669) ~[spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at net.minecraft.server.v1_11_R1.PacketPlayInWindowClick.a(SourceFile:33) ~[spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at net.minecraft.server.v1_11_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) ~[spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_101]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_101]
      	at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) ~[spigot-1.11.2.jar:git-Spigot-283de8b-4316a8c]
      	... 5 more
      
      

      Use case:

      public static void show(Player player, int page) {
          // maven repo not up to date, but server compiled with build tools
          Inventory inventoryShulker = Bukkit.createInventory(null, InventoryType.valueOf("SHULKER_BOX"), "Test Please");
      
          ItemStack icon = new ItemStack(Material.RECORD_3);
          ItemMeta iconMeta = icon.getItemMeta();
          iconMeta.setDisplayName(ChatColor.RED + "Close");
          icon.setItemMeta(iconMeta);
      
          inventoryShulker.setItem(1, icon);
      
          player.openInventory(inventoryShulker);
      }
      

            Unassigned Unassigned
            MarkehMe Mark Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: