Skip to content

Commit

Permalink
cleanup listener
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Mar 8, 2024
1 parent eb8bacf commit 186761a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ default void onDispense(BlockDispenseEvent event) {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
default void onInventoryClick(InventoryClickEvent event) {
ItemStack current = event.getCurrentItem();
ItemStack cursor = event.getCursor();
if (!CachingPermTool.hasPermission(bypassPermission(), event.getWhoClicked())) {
handleItem(current, determineLegality(current));
handleItem(cursor, determineLegality(cursor));
for (ItemStack invItem : event.getWhoClicked().getInventory()) {
handleItem(invItem, determineLegality(invItem));
}
if (CachingPermTool.hasPermission(bypassPermission(), event.getWhoClicked())) return;

handleItem(event.getCurrentItem(), determineLegality(event.getCurrentItem()));
handleItem(event.getCursor(), determineLegality(event.getCursor()));
for (ItemStack invItem : event.getWhoClicked().getInventory()) {
handleItem(invItem, determineLegality(invItem));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@ default void onDispense(BlockDispenseEvent event) {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
default void onInventoryClick(InventoryClickEvent event) {
ItemStack current = event.getCurrentItem();
ItemStack cursor = event.getCursor();
if (!CachingPermTool.hasPermission(bypassPermission(), event.getWhoClicked())) {
handleItem(current, determineLegality(current));
handleItem(cursor, determineLegality(cursor));
for (ItemStack invItem : event.getWhoClicked().getInventory()) {
handleItem(invItem, determineLegality(invItem));
}
if (CachingPermTool.hasPermission(bypassPermission(), event.getWhoClicked())) return;

handleItem(event.getCurrentItem(), determineLegality(event.getCurrentItem()));
handleItem(event.getCursor(), determineLegality(event.getCursor()));
for (ItemStack invItem : event.getWhoClicked().getInventory()) {
handleItem(invItem, determineLegality(invItem));
}
}

Expand Down

0 comments on commit 186761a

Please sign in to comment.