mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Make marker API stay loaded across /dynmap reload (screws up API users otherwise)
This commit is contained in:
parent
e81564c1ae
commit
09637f293e
@ -368,10 +368,9 @@ public class DynmapPlugin extends JavaPlugin {
|
|||||||
ll.clear(); /* Empty list - we use presence of list to remember that we've registered with Bukkit */
|
ll.clear(); /* Empty list - we use presence of list to remember that we've registered with Bukkit */
|
||||||
}
|
}
|
||||||
playerfacemgr = null;
|
playerfacemgr = null;
|
||||||
if(markerapi != null) {
|
|
||||||
markerapi.cleanup(this);
|
/* Don't clean up markerAPI - other plugins may still be accessing it */
|
||||||
markerapi = null;
|
|
||||||
}
|
|
||||||
Debug.clearDebuggers();
|
Debug.clearDebuggers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,12 @@ public class MarkersComponent extends ClientComponent {
|
|||||||
|
|
||||||
public MarkersComponent(DynmapPlugin plugin, ConfigurationNode configuration) {
|
public MarkersComponent(DynmapPlugin plugin, ConfigurationNode configuration) {
|
||||||
super(plugin, configuration);
|
super(plugin, configuration);
|
||||||
/* Register API with plugin */
|
/* Register API with plugin, if needed */
|
||||||
api = MarkerAPIImpl.initializeMarkerAPI(plugin);
|
api = (MarkerAPIImpl)plugin.getMarkerAPI();
|
||||||
plugin.registerMarkerAPI(api);
|
if(api == null) {
|
||||||
|
api = MarkerAPIImpl.initializeMarkerAPI(plugin);
|
||||||
|
plugin.registerMarkerAPI(api);
|
||||||
|
}
|
||||||
/* If configuration has enabled sign support, prime it too */
|
/* If configuration has enabled sign support, prime it too */
|
||||||
if(configuration.getBoolean("enablesigns", false)) {
|
if(configuration.getBoolean("enablesigns", false)) {
|
||||||
signmgr = MarkerSignManager.initializeSignManager(plugin);
|
signmgr = MarkerSignManager.initializeSignManager(plugin);
|
||||||
@ -84,11 +87,6 @@ public class MarkersComponent extends ClientComponent {
|
|||||||
MarkerSignManager.terminateSignManager(this.plugin);
|
MarkerSignManager.terminateSignManager(this.plugin);
|
||||||
signmgr = null;
|
signmgr = null;
|
||||||
}
|
}
|
||||||
if(api != null) {
|
/* Don't unregister API - other plugins might be using it, and we want to keep non-persistent markers */
|
||||||
/* Clean up API registered with plugin */
|
|
||||||
plugin.registerMarkerAPI(null);
|
|
||||||
api.cleanup(this.plugin);
|
|
||||||
api = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user