Skip to content

Commit

Permalink
Fix inventory drag event not properly checking if a player is draggin…
Browse files Browse the repository at this point in the history
…g within their own inventory
  • Loading branch information
Intelli committed Jul 6, 2024
1 parent c67e697 commit 4af9563
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ protected void onInventoryDragEvent(InventoryDragEvent event) {
boolean enderChest = false;

Inventory inventory = event.getInventory();
if (inventory == null || inventory.equals(event.getWhoClicked().getInventory())) {
InventoryHolder inventoryHolder = inventory.getHolder();
if (inventory == null || inventoryHolder != null && inventoryHolder.equals(event.getWhoClicked())) {
return;
}

InventoryHolder inventoryHolder = inventory.getHolder();
enderChest = inventory.equals(event.getWhoClicked().getEnderChest());
if ((inventoryHolder != null && (inventoryHolder instanceof BlockInventoryHolder || inventoryHolder instanceof DoubleChest)) || enderChest) {
movedItem = true;
Expand Down

0 comments on commit 4af9563

Please sign in to comment.