mirror of
https://github.com/BentoBoxWorld/Warps.git
synced 2024-12-01 23:23:23 +01:00
Check for warp file before loading
This commit is contained in:
parent
2bf5299a16
commit
da996714a1
@ -163,15 +163,18 @@ public class WarpSignsManager {
|
|||||||
private void loadWarpList() {
|
private void loadWarpList() {
|
||||||
addon.getLogger().info("Loading warps...");
|
addon.getLogger().info("Loading warps...");
|
||||||
worldsWarpList = new HashMap<>();
|
worldsWarpList = new HashMap<>();
|
||||||
WarpsData warps = handler.loadObject("warps");
|
WarpsData warps = new WarpsData();
|
||||||
// Load into map
|
if (handler.objectExists("warps")) {
|
||||||
if (warps != null) {
|
warps = handler.loadObject("warps");
|
||||||
warps.getWarpSigns().forEach((k,v) -> {
|
// Load into map
|
||||||
if (k != null && (k.getBlock().getType().equals(Material.SIGN) || k.getBlock().getType().equals(Material.WALL_SIGN))) {
|
if (warps != null) {
|
||||||
// Add to map
|
warps.getWarpSigns().forEach((k,v) -> {
|
||||||
getWarpMap(k.getWorld()).put(v, k);
|
if (k != null && (k.getBlock().getType().equals(Material.SIGN) || k.getBlock().getType().equals(Material.WALL_SIGN))) {
|
||||||
}
|
// Add to map
|
||||||
});
|
getWarpMap(k.getWorld()).put(v, k);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user