From be8f3e90908cb1905e9f956303fd5ddc1ac7f73b Mon Sep 17 00:00:00 2001
From: xGinko <rachel.audrey@mail.de>
Date: Mon, 22 Jan 2024 19:00:23 +0100
Subject: [PATCH] actually count up

---
 .../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 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);