Chat: request permission update on world changes.

This commit is contained in:
asofold 2012-09-09 02:37:31 +02:00
parent 8fde82b113
commit b5ee2fe985

View File

@ -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;
@ -62,6 +63,12 @@ public class ChatListener implements Listener, INotifyReload {
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.
*