1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-29 04:18:07 +01:00

Add Null Checks to BlockOwnerShip#clear(UUID)

This commit is contained in:
FireML 2024-03-21 12:10:36 +00:00
parent c96b24bb10
commit b328d5c9fc

View File

@ -259,22 +259,25 @@ public class BlockOwnerShip {
}
public int clear(UUID uuid) {
HashMap<String, blockLoc> ls = blockOwnerShips.remove(uuid);
if (ls == null)
return 0;
HashMap<String, blockLoc> ls = blockOwnerShips.remove(uuid);
if (ls == null) {
return 0;
}
for (blockLoc one : ls.values()) {
one.getBlock().removeMetadata(metadataName, plugin);
for (blockLoc one : ls.values()) {
if (one.getBlock() != null) {
one.getBlock().removeMetadata(metadataName, plugin);
Map<String, UUID> oldRecord = ownerMapByLocation.get(one.getWorldName());
if (oldRecord != null)
oldRecord.remove(one.toVectorString());
Map<String, UUID> oldRecord = ownerMapByLocation.get(one.getWorldName());
if (oldRecord != null)
oldRecord.remove(one.toVectorString());
}
}
return ls.size();
}
return ls.size();
}
public int remove(UUID uuid, String location) {
HashMap<String, blockLoc> ls = blockOwnerShips.get(uuid);
if (ls == null)