Skip to content

Commit

Permalink
Fixed logging
Browse files Browse the repository at this point in the history
Fixed logging while interacting with custom inventory which cancels the event
  • Loading branch information
ThisKarolGajda committed Feb 21, 2024
1 parent 92dea5f commit bfc8008
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/main/java/me/dniym/listeners/fListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -2913,7 +2913,7 @@ public void onInventoryDrag(InventoryDragEvent e) {
}
}

@EventHandler
@EventHandler(priority = org.bukkit.event.EventPriority.HIGH)
public void onInventoryPickup(InventoryClickEvent e) {
if (!(e.getWhoClicked() instanceof Player)) {
return;
Expand Down Expand Up @@ -3135,7 +3135,9 @@ public void onInventoryPickup(InventoryClickEvent e) {
}
}

if (Protections.RemoveOverstackedItems.isEnabled()) {
// Since there is no real way to check if this is custom inventory, this is the only way to stop calling fake-logs for
// events that don't occur at all (interacting with wrong itemstack in custom inventory, won't change the inventory)
if (Protections.RemoveOverstackedItems.isEnabled() && !e.isCancelled()) {

if (p != null) {
is = e.getCurrentItem();
Expand Down

0 comments on commit bfc8008

Please sign in to comment.