Fix bogus warning message on markers component

This commit is contained in:
Mike Primm 2011-09-17 06:52:23 +08:00 committed by mikeprimm
parent 8524eecad5
commit 7d89fe094a
2 changed files with 7 additions and 2 deletions

View File

@ -1254,7 +1254,9 @@ public class DynmapPlugin extends JavaPlugin {
}
return markerapi;
}
public boolean markerAPIInitialized() {
return (markerapi != null);
}
/**
* Register markers API - used by component to supply marker API to plugin
*/

View File

@ -24,7 +24,10 @@ public class MarkersComponent extends ClientComponent {
super(plugin, configuration);
/* Register API with plugin, if needed */
api = (MarkerAPIImpl)plugin.getMarkerAPI();
if(api == null) {
if(plugin.markerAPIInitialized()) {
api = (MarkerAPIImpl)plugin.getMarkerAPI();
}
else {
api = MarkerAPIImpl.initializeMarkerAPI(plugin);
plugin.registerMarkerAPI(api);
}