Problem/Bug InventoryClickEvent unreliable in creative mode

Discussion in 'Bukkit Help' started by Rayzr522, Jul 20, 2016.

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

    Rayzr522

    Before I say anything else, thank you in advance. Any help is VERY appreciated, I'm completely stumped here.

    So, here's my problem:
    1. Clicking on an empty slot (this one isn't really a problem, just odd):
    Survival: Calls InventoryClickEvent with an empty (Material.AIR) item.
    Creative: Doesn't call InventoryClickEvent at all.
    2. The item gotten from e.getCursor() or e.getCurrentItem() (This one is a pretty big problem / bug):
    Survival: Item is an instance of CraftItemStack
    Creative: Item is an instance of ItemStack

    #1 isn't a huge problem, it doesn't really affect my project, however #2 is quite a problem. First of all, #2 shouldn't even be possible. ItemStack is just an interface, so if you were to instantiate it you'd have to fill in the code for all the methods by hand... it should always be another class which implements ItemStack. (I'm aware you can technically instantiate an interface and manually fill in all the methods etc. by hand in the instantiation, but I can't imagine that anyone would do that, especially with a class with this many methods)

    We use a lot of hacky code in our project, some of which includes manipulating NBT values. We use Comphenix's NBT reflection class which I've modified to work with newer versions of Bukkit. It messes up when the class isn't of the type CraftItemStack, so it doesn't work at all in creative mode.

    Again, I would appreciate any help you could give me. This is obviously a very odd problem, so I don't blame you if you can't help me.
     
Thread Status:
Not open for further replies.

Share This Page