mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-26 17:18:43 +01:00
Merge pull request #2142 from dordsor21/master
Cancel plot chat if message event is cancelled to allow for swear block/etc
This commit is contained in:
commit
40e7df8d69
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user