mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-02 08:40:01 +01:00
Chat: request permission update on world changes.
This commit is contained in:
parent
8fde82b113
commit
b5ee2fe985
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user