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:
parent
c96b24bb10
commit
b328d5c9fc
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user