diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index fa4577e26..972c26dfe 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -757,8 +757,11 @@ public class PlayerEvents extends PlotListener implements Listener { } } - @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOW) public void onChat(AsyncPlayerChatEvent event) { + if (event.isCancelled()) + return; + PlotPlayer plotPlayer = BukkitUtil.getPlayer(event.getPlayer()); Location location = plotPlayer.getLocation(); PlotArea area = location.getPlotArea(); diff --git a/Nukkit/src/main/java/com/plotsquared/nukkit/listeners/PlayerEvents.java b/Nukkit/src/main/java/com/plotsquared/nukkit/listeners/PlayerEvents.java index 0fef4ef4d..ec00e0691 100644 --- a/Nukkit/src/main/java/com/plotsquared/nukkit/listeners/PlayerEvents.java +++ b/Nukkit/src/main/java/com/plotsquared/nukkit/listeners/PlayerEvents.java @@ -553,8 +553,11 @@ public class PlayerEvents extends PlotListener implements Listener { } } - @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOW) public void onChat(PlayerChatEvent event) { + if (event.isCancelled()) + return; + PlotPlayer plotPlayer = NukkitUtil.getPlayer(event.getPlayer()); Location location = plotPlayer.getLocation(); PlotArea area = location.getPlotArea(); diff --git a/Sponge/src/main/java/com/plotsquared/sponge/listener/MainListener.java b/Sponge/src/main/java/com/plotsquared/sponge/listener/MainListener.java index 47e570682..693709e8c 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/listener/MainListener.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/listener/MainListener.java @@ -86,6 +86,9 @@ public class MainListener { @Listener public void onChat(MessageEvent event) { // TODO + if (event.isMessageCancelled()) + return; + Player player = SpongeUtil.getCause(event.getCause(), Player.class); if (player == null) { return;