Skip to content

Commit

Permalink
Prevent players from using the offhand swap key to move the backpack …
Browse files Browse the repository at this point in the history
…item (fixes #162)
  • Loading branch information
GeorgH93 committed Apr 22, 2021
1 parent c0002f7 commit 28796ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<packaging>pom</packaging>

<properties>
<revision>2.3.23</revision>
<revision>2.3.24</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
Expand Down

0 comments on commit 28796ef

Please sign in to comment.