diff --git a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/lagpreventions/InventoryActionLag.java b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/lagpreventions/InventoryActionLag.java index 3f67c51d2..5e30f3795 100755 --- a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/lagpreventions/InventoryActionLag.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/lagpreventions/InventoryActionLag.java @@ -101,7 +101,9 @@ private void onInventoryClick(InventoryClickEvent event) { Map<InventoryAction, Integer> recordedClicks = blockInventoryClicks.getIfPresent(block.getLocation()); if (recordedClicks == null) recordedClicks = new EnumMap<>(InventoryAction.class); Integer clickActionCounter = recordedClicks.get(event.getAction()); - if (clickActionCounter == null) clickActionCounter = 1; + if (clickActionCounter == null) clickActionCounter = 0; + + clickActionCounter++; if (clickActionCounter > clickActionLimits.get(event.getAction())) { event.setCancelled(true); diff --git a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/lagpreventions/InventoryActionLag.java b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/lagpreventions/InventoryActionLag.java index e79d0862c..9ef7bf689 100755 --- a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/lagpreventions/InventoryActionLag.java +++ b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/lagpreventions/InventoryActionLag.java @@ -96,7 +96,9 @@ private void onInventoryClick(InventoryClickEvent event) { Map<InventoryAction, Integer> recordedClicks = blockInventoryClicks.getIfPresent(block.getLocation()); if (recordedClicks == null) recordedClicks = new EnumMap<>(InventoryAction.class); Integer clickActionCounter = recordedClicks.get(event.getAction()); - if (clickActionCounter == null) clickActionCounter = 1; + if (clickActionCounter == null) clickActionCounter = 0; + + clickActionCounter++; if (clickActionCounter > clickActionLimits.get(event.getAction())) { event.setCancelled(true);