forked from MagicBane/Server
Refactored assignment.
This commit is contained in:
@@ -967,19 +967,8 @@ public class Building extends AbstractWorldObject {
|
|||||||
|
|
||||||
// Reference friend and condemn lists from BuildingManager
|
// Reference friend and condemn lists from BuildingManager
|
||||||
|
|
||||||
this.friends = BuildingManager._buildingFriends.get(this.getObjectUUID());
|
this.friends = BuildingManager._buildingFriends.computeIfAbsent(this.getObjectUUID(), k -> new ConcurrentHashMap<>());
|
||||||
|
this.condemned = BuildingManager._buildingCondemned.computeIfAbsent(this.getObjectUUID(), k -> new ConcurrentHashMap<>());
|
||||||
if (this.friends == null) {
|
|
||||||
this.friends = new ConcurrentHashMap<>();
|
|
||||||
BuildingManager._buildingFriends.put(this.getObjectUUID(), this.friends);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.condemned = BuildingManager._buildingCondemned.get(this.getObjectUUID());
|
|
||||||
|
|
||||||
if (this.condemned == null) {
|
|
||||||
this.condemned = new ConcurrentHashMap<>();
|
|
||||||
BuildingManager._buildingCondemned.put(this.getObjectUUID(), this.condemned);
|
|
||||||
}
|
|
||||||
|
|
||||||
//LOad Owners in Cache so we do not have to continuely look in the db for owner.
|
//LOad Owners in Cache so we do not have to continuely look in the db for owner.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user