Skip to content

Commit

Permalink
fix here as well
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Jan 22, 2024
1 parent be8f3e9 commit 2b0f74c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ private void onInventoryClick(InventoryClickEvent event) {
Map<InventoryAction, Integer> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ private void onInventoryClick(InventoryClickEvent event) {
Map<InventoryAction, Integer> 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);
Expand Down

0 comments on commit 2b0f74c

Please sign in to comment.