From 530651688ea8580daca130a086a69a23e47e2da6 Mon Sep 17 00:00:00 2001 From: Matt <58913953+ms5984@users.noreply.github.com> Date: Sat, 15 May 2021 01:32:00 -0400 Subject: [PATCH 1/2] Test with ignoreCancelled = true --- .../hempfest/clans/util/listener/PlayerEventListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/youtube/hempfest/clans/util/listener/PlayerEventListener.java b/src/main/java/com/youtube/hempfest/clans/util/listener/PlayerEventListener.java index c5813b4..ab0e40d 100644 --- a/src/main/java/com/youtube/hempfest/clans/util/listener/PlayerEventListener.java +++ b/src/main/java/com/youtube/hempfest/clans/util/listener/PlayerEventListener.java @@ -166,7 +166,7 @@ public void onPlayerDeath(PlayerDeathEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBucketRelease(PlayerBucketEmptyEvent event) { ClaimInteractEvent e = new ClaimInteractEvent(event.getPlayer(), event.getBlock().getLocation()); Bukkit.getPluginManager().callEvent(e); @@ -174,7 +174,7 @@ public void onBucketRelease(PlayerBucketEmptyEvent event) { event.setCancelled(e.isCancelled()); } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBucketFill(PlayerBucketFillEvent event) { ClaimInteractEvent e = new ClaimInteractEvent(event.getPlayer(), event.getBlock().getLocation()); Bukkit.getPluginManager().callEvent(e); From 8fa5ff7800849a2f9d2c488d0e9f1a5bcb9dbc5f Mon Sep 17 00:00:00 2001 From: Matt <58913953+ms5984@users.noreply.github.com> Date: Sat, 15 May 2021 01:41:43 -0400 Subject: [PATCH 2/2] Only set on isCancelled --- .../hempfest/clans/util/listener/PlayerEventListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/youtube/hempfest/clans/util/listener/PlayerEventListener.java b/src/main/java/com/youtube/hempfest/clans/util/listener/PlayerEventListener.java index ab0e40d..1712819 100644 --- a/src/main/java/com/youtube/hempfest/clans/util/listener/PlayerEventListener.java +++ b/src/main/java/com/youtube/hempfest/clans/util/listener/PlayerEventListener.java @@ -171,7 +171,7 @@ public void onBucketRelease(PlayerBucketEmptyEvent event) { ClaimInteractEvent e = new ClaimInteractEvent(event.getPlayer(), event.getBlock().getLocation()); Bukkit.getPluginManager().callEvent(e); e.handleCheck(); - event.setCancelled(e.isCancelled()); + if (e.isCancelled()) event.setCancelled(true); } @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) @@ -179,7 +179,7 @@ public void onBucketFill(PlayerBucketFillEvent event) { ClaimInteractEvent e = new ClaimInteractEvent(event.getPlayer(), event.getBlock().getLocation()); Bukkit.getPluginManager().callEvent(e); e.handleCheck(); - event.setCancelled(e.isCancelled()); + if (e.isCancelled()) event.setCancelled(true); } @EventHandler(priority = EventPriority.NORMAL)