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:
parent
4f39da6db4
commit
d5c942363e
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user