Fixes the problem with Dynmap disabling Stargate
This commit is contained in:
@@ -131,6 +131,14 @@ public final class DynmapManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables Dynmap integration
|
||||||
|
*/
|
||||||
|
public static void disable() {
|
||||||
|
markerSet = null;
|
||||||
|
portalIcon = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the id used for the given portal's marker
|
* Gets the id used for the given portal's marker
|
||||||
*
|
*
|
||||||
|
@@ -112,15 +112,21 @@ public final class StargateConfig {
|
|||||||
setupVaultEconomy();
|
setupVaultEconomy();
|
||||||
|
|
||||||
//Set up dynmap
|
//Set up dynmap
|
||||||
DynmapAPI dynmapAPI = (DynmapAPI) Bukkit.getPluginManager().getPlugin("dynmap");
|
try {
|
||||||
if (dynmapAPI != null) {
|
DynmapAPI dynmapAPI = (DynmapAPI) Bukkit.getPluginManager().getPlugin("dynmap");
|
||||||
try {
|
if (dynmapAPI != null) {
|
||||||
DynmapManager.initialize(dynmapAPI);
|
try {
|
||||||
DynmapManager.addAllPortalMarkers();
|
DynmapManager.initialize(dynmapAPI);
|
||||||
} catch (NullPointerException exception) {
|
DynmapManager.addAllPortalMarkers();
|
||||||
logger.warning("Dynmap started in an invalid state. Check your log/console for dynmap-related " +
|
} catch (NullPointerException ignored) {
|
||||||
"problems. Dynmap integration cannot be initialized.");
|
logger.warning("Dynmap started in an invalid state. Check your log/console for dynmap-related " +
|
||||||
|
"problems. Dynmap integration cannot be initialized.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (NoClassDefFoundError error) {
|
||||||
|
logger.warning("Dynmap seems to be unavailable, even though its API is registered. Dynmap " +
|
||||||
|
"integration is disabled.");
|
||||||
|
DynmapManager.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isLoaded = true;
|
this.isLoaded = true;
|
||||||
|
Reference in New Issue
Block a user