mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 05:05:16 +01:00
Added getters/setters.
This commit is contained in:
parent
c2047fe7c4
commit
5ee5fee232
@ -17,8 +17,8 @@ public class DynmapPlugin extends JavaPlugin {
|
|||||||
|
|
||||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||||
|
|
||||||
private WebServer webserver = null;
|
private WebServer webServer = null;
|
||||||
private MapManager mgr = null;
|
private MapManager mapManager = null;
|
||||||
private PlayerList playerList;
|
private PlayerList playerList;
|
||||||
|
|
||||||
private BukkitPlayerDebugger debugger = new BukkitPlayerDebugger(this);
|
private BukkitPlayerDebugger debugger = new BukkitPlayerDebugger(this);
|
||||||
@ -34,6 +34,14 @@ public class DynmapPlugin extends JavaPlugin {
|
|||||||
return getServer().getWorlds()[0];
|
return getServer().getWorlds()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapManager getMapManager() {
|
||||||
|
return mapManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebServer getWebServer() {
|
||||||
|
return webServer;
|
||||||
|
}
|
||||||
|
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
Configuration configuration = new Configuration(new File(this.getDataFolder(), "configuration.txt"));
|
Configuration configuration = new Configuration(new File(this.getDataFolder(), "configuration.txt"));
|
||||||
configuration.load();
|
configuration.load();
|
||||||
@ -42,11 +50,11 @@ public class DynmapPlugin extends JavaPlugin {
|
|||||||
playerList = new PlayerList(getServer());
|
playerList = new PlayerList(getServer());
|
||||||
playerList.load();
|
playerList.load();
|
||||||
|
|
||||||
mgr = new MapManager(getWorld(), debugger, configuration);
|
mapManager = new MapManager(getWorld(), debugger, configuration);
|
||||||
mgr.startManager();
|
mapManager.startManager();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
webserver = new WebServer(mgr, getServer(), playerList, debugger, configuration);
|
webServer = new WebServer(mapManager, getServer(), playerList, debugger, configuration);
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
log.info("position failed to start WebServer (IOException)");
|
log.info("position failed to start WebServer (IOException)");
|
||||||
}
|
}
|
||||||
@ -55,21 +63,21 @@ public class DynmapPlugin extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
mgr.stopManager();
|
mapManager.stopManager();
|
||||||
|
|
||||||
if(webserver != null) {
|
if(webServer != null) {
|
||||||
webserver.shutdown();
|
webServer.shutdown();
|
||||||
webserver = null;
|
webServer = null;
|
||||||
}
|
}
|
||||||
debugger.disable();
|
debugger.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerEvents() {
|
public void registerEvents() {
|
||||||
BlockListener blockListener = new DynmapBlockListener(mgr);
|
BlockListener blockListener = new DynmapBlockListener(mapManager);
|
||||||
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
|
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
|
||||||
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Normal, this);
|
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Normal, this);
|
||||||
|
|
||||||
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, new DynmapPlayerListener(mgr, playerList), Priority.Normal, this);
|
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, new DynmapPlayerListener(mapManager, playerList), Priority.Normal, this);
|
||||||
//getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DESTROYED, listener, Priority.Normal, this);
|
//getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DESTROYED, listener, Priority.Normal, this);
|
||||||
/* etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM);
|
/* etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM);
|
||||||
etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.MEDIUM);
|
etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.MEDIUM);
|
||||||
|
Loading…
Reference in New Issue
Block a user