Weird Exceptions in Console

Discussion in 'Plugin Development' started by boysnnoco, Jul 30, 2014.

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

    boysnnoco

    While trying to make a Wishlist plugin I ran into a bit of a problem, when I close the original inventory (that is opened by the use of a command) it is ment to open a new inventory with all the items. (code below)
    Code:java
    1. public static void openWantInventory(Player player) {
    2.  
    3. Inventory inv = Bukkit.createInventory(null, 54,"§8What are you willing to take:");
    4.  
    5. for (int i = 0; i < 9; i++) {
    6. inv.setItem(i, getItem(new ItemStack(Material.THIN_GLASS), ""));
    7. }
    8.  
    9. inv.setItem(4, getItem(new ItemStack(Material.SULPHUR), "§cExit"));
    10. inv.setItem(0, getItem(new ItemStack(Material.REDSTONE), "§cPage 1"));
    11. inv.setItem(8, getItem(new ItemStack(Material.SUGAR), "§2Page 2"));
    12. int count = 9;
    13. for(Material mat : Material.values()) {
    14. if(count > 45)
    15. break;
    16. inv.addItem(new ItemStack(mat));
    17. count++;
    18. }
    19. player.openInventory(inv); //Line 45
    20.  
    21. }

    and it keeps saying there is an error at line 45 (marked) and I have no idea why (error below)
    Code:
    Could not pass event InventoryCloseEvent to WishList v1.0
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.handleInventoryCloseEvent(CraftEventFactory.java:721) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.EntityPlayer.closeInventory(EntityPlayer.java:816) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.EntityPlayer.openContainer(EntityPlayer.java:623) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity.openInventory(CraftHumanEntity.java:193) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at me.boysnnoco.WishList.Utilities.InventoryHelpers.openWantInventory(InventoryHelpers.java:43) ~[?:?]
        at me.boysnnoco.WishList.Listeners.PlayerListeners.onClose(PlayerListeners.java:34) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_65]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_65]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.handleInventoryCloseEvent(CraftEventFactory.java:721) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.EntityPlayer.closeInventory(EntityPlayer.java:816) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.EntityPlayer.openContainer(EntityPlayer.java:623) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity.openInventory(CraftHumanEntity.java:193) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at me.boysnnoco.WishList.Utilities.InventoryHelpers.openWantInventory(InventoryHelpers.java:43) ~[?:?]
        at me.boysnnoco.WishList.Listeners.PlayerListeners.onClose(PlayerListeners.java:34) ~[?:?]
    Any help would be appreciated
    ~Cheesy
    BTW if you need any other code feel free to ask!
     
  2. Offline

    fireblast709

  3. Offline

    boysnnoco

    fireblast709 alright ill try that
    EDIT: Thank you so much it worked!
     
Thread Status:
Not open for further replies.

Share This Page