Fix off-server-thread calls to get player list
This commit is contained in:
parent
1253ac2e6a
commit
978a203aa9
2 changed files with 33 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue