mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-14 10:45:23 +01:00
Prevent players from using the offhand swap key to move the backpack item (fixes #162)
This commit is contained in:
parent
c0002f75a5
commit
28796ef0f7
@ -262,6 +262,14 @@ else if((event.getAction() == InventoryAction.HOTBAR_MOVE_AND_READD || event.get
|
||||
messageDoNotRemoveItem.send(player);
|
||||
}
|
||||
}
|
||||
else if((event.getAction() == InventoryAction.HOTBAR_MOVE_AND_READD || event.getAction() == InventoryAction.HOTBAR_SWAP) && event.getClick().name().equals("SWAP_OFFHAND"))
|
||||
{
|
||||
if(isItemShortcut(player.getInventory().getItemInOffHand()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
messageDoNotRemoveItem.send(player);
|
||||
}
|
||||
}
|
||||
else if(isItemShortcut(event.getCursor()))
|
||||
{
|
||||
if(!player.getInventory().equals(event.getClickedInventory()))
|
||||
|
Loading…
Reference in New Issue
Block a user