From 4af95632d5e76629ce01126fe25e8ca38a147844 Mon Sep 17 00:00:00 2001 From: Intelli Date: Sat, 6 Jul 2024 12:03:54 -0600 Subject: [PATCH] Fix inventory drag event not properly checking if a player is dragging within their own inventory --- .../coreprotect/listener/player/InventoryChangeListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/coreprotect/listener/player/InventoryChangeListener.java b/src/main/java/net/coreprotect/listener/player/InventoryChangeListener.java index 01082e0..2cbdf35 100644 --- a/src/main/java/net/coreprotect/listener/player/InventoryChangeListener.java +++ b/src/main/java/net/coreprotect/listener/player/InventoryChangeListener.java @@ -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;