From a257b604ea9a5f1f03205dccc24b25a38ce0f1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20M=C3=BCller?= Date: Sun, 21 Dec 2025 09:32:40 +0100 Subject: [PATCH] updated `InventoryTrackerListener` to monitor `InventoryOpenEvent` with high priority and prevent processing of cancelled events --- .../security/antiInventoryMove/InventoryTrackerListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/eu/mhsl/craftattack/spawn/common/appliances/security/antiInventoryMove/InventoryTrackerListener.java b/common/src/main/java/eu/mhsl/craftattack/spawn/common/appliances/security/antiInventoryMove/InventoryTrackerListener.java index 0c5c89f..7e064d4 100644 --- a/common/src/main/java/eu/mhsl/craftattack/spawn/common/appliances/security/antiInventoryMove/InventoryTrackerListener.java +++ b/common/src/main/java/eu/mhsl/craftattack/spawn/common/appliances/security/antiInventoryMove/InventoryTrackerListener.java @@ -3,13 +3,15 @@ package eu.mhsl.craftattack.spawn.common.appliances.security.antiInventoryMove; import eu.mhsl.craftattack.spawn.core.appliance.ApplianceListener; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryOpenEvent; class InventoryTrackerListener extends ApplianceListener { - @EventHandler + @EventHandler(priority = EventPriority.MONITOR) public void onOpen(InventoryOpenEvent event) { if(!(event.getPlayer() instanceof Player player)) return; + if(event.isCancelled()) return; this.getAppliance().setInvOpen(player, true); }