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

Can not create Inventory with an custom size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • OS: Linux, openjdk version "1.8.0_191"

    • git-Spigot-6dbf995-0ec9b61
    • Yes

      You can not create an Inventory with an custom size.

      Source Code: https://hastebin.com/tiqoqazuxa.java

      The JavaDocs mentions that you can use multiples of nine: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#createInventory-org.bukkit.inventory.InventoryHolder-int-java.lang.String-

      but only 27 and 54 works

      Error: 
      java.lang.IllegalArgumentException: Container size 18 is smaller than expected 27
      at net.minecraft.server.v1_14_R1.Container.a(Container.java:80) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.ContainerChest.<init>(ContainerChest.java:74) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.inventory.CraftContainer.setupSlots(CraftContainer.java:171) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.inventory.CraftContainer.<init>(CraftContainer.java:53) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.inventory.CraftContainer.<init>(CraftContainer.java:82) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.entity.CraftHumanEntity.openCustomInventory(CraftHumanEntity.java:451) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.entity.CraftHumanEntity.openInventory(CraftHumanEntity.java:336) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at de.derniklaas.spigot.Spigot.onEnable(Spigot.java:15) ~[?:?]
      at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:346) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:408) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugin(CraftServer.java:458) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugins(CraftServer.java:372) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.CraftServer.reload(CraftServer.java:805) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.Bukkit.reload(Bukkit.java:576) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:145) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:707) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1667) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1507) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:13) ~[server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) [server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.h(SourceFile:135) [server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.h(SourceFile:23) [server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.p(SourceFile:114) [server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.MinecraftServer.aW(MinecraftServer.java:876) [server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.MinecraftServer.p(MinecraftServer.java:869) [server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.c(SourceFile:123) [server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:853) [server.jar:git-Spigot-6dbf995-0ec9b61]
      at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:793) [server.jar:git-Spigot-6dbf995-0ec9b61]

            Unassigned Unassigned
            derNiklaas derNiklaas
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: