Problem/Bug Hotkeying into Custom Inventory

Discussion in 'Plugin Help/Development/Requests' started by TfwMinecraft, Feb 17, 2016.

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

    TfwMinecraft

    For my PvP plugin, I have a custom inventory that can be opened by right clicking a compass. A bug that someone recently discovered is that if you hover your cursor in the custom inventory and press the corresponding key to where your compass is located in your hotbar, it places it in the inventory for everyone to see. I've tried patching the bug by doing:

    Code:
    else if(inventory.getName().equals(kitInventory.getName()))
                {
                   
                    if(event.getAction().equals(InventoryAction.MOVE_TO_OTHER_INVENTORY))
                    {
                        event.setCancelled(true);
                    }
                   
                    else if(event.getClick().isKeyboardClick())
                    {
                        event.setCancelled(true);
                    }
                   
                    else if(event.getClick().isKeyboardClick() && event.getAction().equals(InventoryAction.MOVE_TO_OTHER_INVENTORY))
                    {
                        event.setCancelled(true);
                    }
                   
                    else if(event.getAction().equals(InventoryAction.HOTBAR_SWAP))
                    {
                        event.setCancelled(true);
                    }
    But none of those worked. They only cancel if it occurs within the player's inventory, not if it's in the custom inventory. Can someone please help me patch this bug? I spent two hours trying to patch it.
     
Thread Status:
Not open for further replies.

Share This Page