Fix off-server-thread calls to get player list

This commit is contained in:
Mike Primm 2011-10-12 13:18:00 +08:00 committed by mikeprimm
parent 1253ac2e6a
commit 978a203aa9
2 changed files with 33 additions and 3 deletions

View file

@ -268,6 +268,16 @@ public class DynmapPlugin extends JavaPlugin {
playerList = new PlayerList(getServer(), getFile("hiddenplayers.txt"), configuration);
playerList.load();
PlayerListener pl = new PlayerListener() {
public void onPlayerJoin(PlayerJoinEvent evt) {
playerList.updateOnlinePlayers(null);
}
public void onPlayerQuit(PlayerQuitEvent evt) {
playerList.updateOnlinePlayers(evt.getPlayer());
}
};
registerEvent(Type.PLAYER_JOIN, pl);
registerEvent(Type.PLAYER_QUIT, pl);
mapManager = new MapManager(this, configuration);
mapManager.startRendering();