Solved I can't figure out what is causing this Exception.

Discussion in 'Plugin Development' started by HRSN0410, Jul 2, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    HRSN0410

    Hello!

    I've been developing a Bukkit plugin that allows you to switch resourcepacks in-game using a GUI.

    I have a class where I am running a command (not the class I have posted) and a class that gets the GUI for a player (it shows what resource pack they have enabled)

    If you need any other classes, just ask!

    The class that is causing the error can be found here. (Pastebin)

    The error is here:
    Error (open)
    Code:
    [10:16:44 ERROR]: null
    
    org.bukkit.command.CommandException: Unhandled exception executing command 'rps' in plugin ResourcePacks v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646) ~[spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1115) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:950) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0_75]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.7.0_75]
            at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:696) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at java.lang.Thread.run(Unknown Source) [?:1.7.0_75]
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 18
            at org.bukkit.craftbukkit.v1_8_R1.inventory.CraftInventoryCustom$MinecraftInventory.setItem(CraftInventoryCustom.java:105) ~[spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at org.bukkit.craftbukkit.v1_8_R1.inventory.CraftInventory.setItem(CraftInventory.java:81) ~[spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            at me.hrsn0410.rp.Menu.getResourcePackMenu(Menu.java:94) ~[?:?]
            at me.hrsn0410.rp.ResourcePacks.onCommand(ResourcePacks.java:34) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-ed3e3af-ee6d0fa]
            ... 14 more
     
  2. @HRSN0410 Your inventory is only 9 slots, and you're trying to set some of your items in slots that don't exist. Thus, throwing an NPE. For your plugin to work, you'd need to set the amount of slots to 54 (the max slots an inventory can have without being buggy).
     
  3. Offline

    HRSN0410

    Ah I see. That was a placeholder and I forgot to replace it :)
     
Thread Status:
Not open for further replies.

Share This Page