Fix inventory drag event not properly checking if a player is dragging within their own inventory

This commit is contained in:
Intelli 2024-07-06 12:03:54 -06:00
parent c67e69755d
commit 4af95632d5

View File

@ -294,11 +294,11 @@ public final class InventoryChangeListener extends Queue implements Listener {
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;