Skip to content

Commit

Permalink
Don't un-cancel events
Browse files Browse the repository at this point in the history
  • Loading branch information
drfiveminusmint committed Oct 3, 2024
1 parent fb3d9ca commit 75dccc8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
public class PlayerInteractListener implements Listener {
@EventHandler(priority = EventPriority.NORMAL)
public void onClick(@NotNull PlayerInteractEvent event) {
event.setCancelled(switch (event.getAction()) {
if(switch (event.getAction()) {
case RIGHT_CLICK_AIR -> rightClick(event);
case RIGHT_CLICK_BLOCK -> rightClickBlock(event);
case LEFT_CLICK_BLOCK -> leftClickBlock(event);
default -> false;
});
})
event.setCancelled(true); //don't un-cancel events
}

private boolean leftClickBlock(@NotNull PlayerInteractEvent event) {
Expand Down

0 comments on commit 75dccc8

Please sign in to comment.