From 2b0f74c79da71f5a0be8d794f0dd4cf14a501e9e Mon Sep 17 00:00:00 2001 From: xGinko Date: Mon, 22 Jan 2024 19:00:53 +0100 Subject: [PATCH] fix here as well --- .../modules/lagpreventions/InventoryActionLag.java | 4 +++- .../modules/lagpreventions/InventoryActionLag.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 5e30f3795..1cdd1657e 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 @@ -125,7 +125,9 @@ private void onInventoryClick(InventoryClickEvent event) { Map recordedClicks = entityInventoryClicks.getIfPresent(entity.getUniqueId()); 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 9ef7bf689..de6203121 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 @@ -121,7 +121,9 @@ private void onInventoryClick(InventoryClickEvent event) { Map recordedClicks = entityInventoryClicks.getIfPresent(entity.getUniqueId()); 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);