mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-08 09:27:38 +01:00
Added protection against incompatible Dynmap plugins
https://github.com/BentoBoxWorld/BentoBox/issues/938
This commit is contained in:
parent
24b1689b03
commit
5c1824050a
@ -32,17 +32,22 @@ public class DynmapHook extends Hook {
|
||||
|
||||
@Override
|
||||
public boolean hook() {
|
||||
DynmapAPI dynmapAPI = (DynmapAPI) getPlugin();
|
||||
MarkerAPI markers = dynmapAPI.getMarkerAPI();
|
||||
try {
|
||||
DynmapAPI dynmapAPI = (DynmapAPI) getPlugin();
|
||||
|
||||
if (markers == null) {
|
||||
MarkerAPI markers = dynmapAPI.getMarkerAPI();
|
||||
|
||||
if (markers == null) {
|
||||
return false;
|
||||
}
|
||||
markerAPI = markers;
|
||||
|
||||
BentoBox.getInstance().getAddonsManager().getGameModeAddons().forEach(this::registerMarkerSet);
|
||||
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
markerAPI = markers;
|
||||
|
||||
BentoBox.getInstance().getAddonsManager().getGameModeAddons().forEach(this::registerMarkerSet);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void registerMarkerSet(@NonNull GameModeAddon addon) {
|
||||
@ -79,6 +84,6 @@ public class DynmapHook extends Hook {
|
||||
|
||||
@Override
|
||||
public String getFailureCause() {
|
||||
return "the version of dynmap you're using is incompatible with this hook";
|
||||
return "the version of dynmap you're using is incompatible with this hook. Use a newer version.";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user