From b5ee2fe985145f91db8d9865b682a88e3bd86a01 Mon Sep 17 00:00:00 2001 From: asofold Date: Sun, 9 Sep 2012 02:37:31 +0200 Subject: [PATCH] Chat: request permission update on world changes. --- .../neatmonster/nocheatplus/checks/chat/ChatListener.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fr/neatmonster/nocheatplus/checks/chat/ChatListener.java b/src/fr/neatmonster/nocheatplus/checks/chat/ChatListener.java index 728edb8c..425b1f8e 100644 --- a/src/fr/neatmonster/nocheatplus/checks/chat/ChatListener.java +++ b/src/fr/neatmonster/nocheatplus/checks/chat/ChatListener.java @@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerLoginEvent.Result; @@ -61,6 +62,12 @@ public class ChatListener implements Listener, INotifyReload { chatCommands.clear(); chatCommands.feedAll(config.getStringList(ConfPaths.CHAT_GLOBALCHAT_COMMANDS), false, true); } + + @EventHandler(priority=EventPriority.MONITOR) + public void onPlayerChangedWorld(final PlayerChangedWorldEvent event){ + // Tell TickTask to update cached permissions. + TickTask.requestPermissionUpdate(event.getPlayer().getName(), CheckType.CHAT); + } /** * We listen to PlayerChat events for obvious reasons.