mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2025-01-04 18:57:47 +01:00
Fix inventory drag event not properly checking if a player is dragging within their own inventory
This commit is contained in:
parent
c67e69755d
commit
4af95632d5
@ -294,11 +294,11 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||||||
boolean enderChest = false;
|
boolean enderChest = false;
|
||||||
|
|
||||||
Inventory inventory = event.getInventory();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InventoryHolder inventoryHolder = inventory.getHolder();
|
|
||||||
enderChest = inventory.equals(event.getWhoClicked().getEnderChest());
|
enderChest = inventory.equals(event.getWhoClicked().getEnderChest());
|
||||||
if ((inventoryHolder != null && (inventoryHolder instanceof BlockInventoryHolder || inventoryHolder instanceof DoubleChest)) || enderChest) {
|
if ((inventoryHolder != null && (inventoryHolder instanceof BlockInventoryHolder || inventoryHolder instanceof DoubleChest)) || enderChest) {
|
||||||
movedItem = true;
|
movedItem = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user