Fixed null check running before Dynmap API fully loads (#137)

This commit is contained in:
Hutchy 2020-03-12 03:37:55 +11:00 committed by GitHub
parent 371aa8aa4d
commit ab9250d67e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View File

@ -81,11 +81,6 @@ public void apiEnabled(DynmapCommonAPI api) {
activate();
}
});
if (this.markerapi == null) {
this.logger.severe("Error loading Dynmap Provider! Could not locate Marker API.");
return;
}
GriefDefender.getEventManager().register(this);
}
private Map<String, AreaMarker> areaMarkers = new HashMap<String, AreaMarker>();
@ -278,6 +273,7 @@ private void updateClaims() {
private void activate() {
this.markerapi = this.dynmap.getMarkerAPI();
if (this.markerapi == null) {
this.logger.severe("Error loading Dynmap Provider! Could not locate Marker API.");
return;
}
if (this.reload) {
@ -311,6 +307,7 @@ private void activate() {
this.set.setHideByDefault(this.cfg.layerHideByDefault);
new GriefDefenderUpdate(40L);
GriefDefender.getEventManager().register(this);
this.logger.info("Dynmap provider is activated");
}

View File

@ -83,11 +83,6 @@ public void apiEnabled(DynmapCommonAPI api) {
activate();
}
});
if (this.markerapi == null) {
this.logger.error("Error loading Dynmap Provider! Could not locate Marker API.");
return;
}
GriefDefender.getEventManager().register(this);
}
private Map<String, AreaMarker> areaMarkers = new HashMap<String, AreaMarker>();
@ -280,6 +275,7 @@ private void updateClaims() {
private void activate() {
this.markerapi = this.dynmap.getMarkerAPI();
if (this.markerapi == null) {
this.logger.error("Error loading Dynmap Provider! Could not locate Marker API.");
return;
}
if (this.reload) {
@ -313,6 +309,7 @@ private void activate() {
this.set.setHideByDefault(this.cfg.layerHideByDefault);
new GriefDefenderUpdate(40L);
GriefDefender.getEventManager().register(this);
this.logger.info("Dynmap provider is activated");
}