(Inventory related) NPEs

Discussion in 'Plugin Development' started by tangochicken, Jun 6, 2013.

Thread Status:
Not open for further replies.
  1. Hello fellow devs!

    I have been working on a plugin that uses an inventory as a GUI. It has worked brilliantly so far until I came to closing the inventory. It gives a null pointer exception for line 269 of the plugin which is:
    Code:
    Clicker.closeInventory();
    Please note that "Clicker" is a HumanEntity linked to a specific player name.

    I am guessing that it wants me to check if the player has an inventory open, before closing it. If this is right, could someone help me to check if the player has an inventory open. If it isn't, any ideas?

    Thanks in advance!
     
  2. Offline

    adam753

  3. Thanks Adam, I never thought to check if it was a bug... I tried to work around this by changing Clicker to Player, rather than HumanEntity. It seems that the bug exists for that too.... So, anyone have any ideas for a work around?
     
  4. Offline

    adam753

    Does Clicker.getOpenInventory().close() give the same error? Or does it not do the same thing?
     

  5. Unfortunately, yes....
     
  6. Offline

    adam753

    I'm not sure there will be a work-around then, sorry. Maybe it would help you to send a cynical email to the bukkit devs? That's what I'd do.
     
Thread Status:
Not open for further replies.

Share This Page