1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 22:13:25 +01:00

Fix issue when the world is not exists and throws errors

This commit is contained in:
montlikadani 2020-03-08 14:12:29 +01:00
parent 4f39da6db4
commit d5c942363e
2 changed files with 10 additions and 4 deletions

View File

@ -350,15 +350,16 @@ public class FurnaceBrewingHandling {
List<blockLoc> ls = brewingMap.remove(uuid);
if (ls == null)
return 0;
for (blockLoc one : ls) {
Block block = one.getBlock();
if (block == null)
continue;
if (!CMIMaterial.get(block).equals(CMIMaterial.BREWING_STAND))
continue;
block.removeMetadata(JobsPaymentListener.brewingOwnerMetadata, Jobs.getInstance());
if (CMIMaterial.get(block).equals(CMIMaterial.BREWING_STAND))
block.removeMetadata(JobsPaymentListener.brewingOwnerMetadata, Jobs.getInstance());
}
return ls.size();
}

View File

@ -84,10 +84,15 @@ public class blockLoc {
World w = this.w == null ? Bukkit.getWorld(worldName) : this.w;
if (w == null)
return null;
w = Bukkit.getWorld(w.getName());
if (w == null) {
return null;
}
this.w = w;
Location loc = new Location(w, x, y, z);
return loc;
}
}