New collection created in handled and loaded from db

This commit is contained in:
2023-10-18 12:54:06 -04:00
parent 5ac62d60be
commit 2cc37481ca
7 changed files with 84 additions and 77 deletions
+7 -7
View File
@@ -42,7 +42,7 @@ public enum BuildingManager {
public static HashMap<Integer, ArrayList<BuildingLocation>> _slotLocations = new HashMap<>();
public static HashMap<Integer, ConcurrentHashMap<Integer, BuildingFriends>> _buildingFriends = new HashMap<>();
public static HashMap<Integer, ConcurrentHashMap<Integer, Condemned>> _buildingCondemned = new HashMap<>();
public static int getAvailableSlot(Building building) {
ArrayList<BuildingLocation> slotLocations = _slotLocations.get(building.meshUUID);
@@ -497,18 +497,18 @@ public enum BuildingManager {
Condemned condemn = building.getCondemned().get(player.getObjectUUID());
if (condemn != null && condemn.isActive())
if (condemn != null && condemn.active)
return true;
if (player.getGuild() != null) {
Condemned guildCondemn = building.getCondemned().get(player.getGuild().getObjectUUID());
if (guildCondemn != null && guildCondemn.isActive())
if (guildCondemn != null && guildCondemn.active)
return true;
Condemned nationCondemn = building.getCondemned().get(player.getGuild().getNation().getObjectUUID());
return nationCondemn != null && nationCondemn.isActive() && nationCondemn.getFriendType() == Condemned.NATION;
return nationCondemn != null && nationCondemn.active && nationCondemn.friendType == Condemned.NATION;
} else {
//TODO ADD ERRANT KOS CHECK
}
@@ -516,18 +516,18 @@ public enum BuildingManager {
Condemned condemn = building.getCondemned().get(player.getObjectUUID());
if (condemn != null && condemn.isActive())
if (condemn != null && condemn.active)
return false;
if (player.getGuild() != null) {
Condemned guildCondemn = building.getCondemned().get(player.getGuild().getObjectUUID());
if (guildCondemn != null && guildCondemn.isActive())
if (guildCondemn != null && guildCondemn.active)
return false;
Condemned nationCondemn = building.getCondemned().get(player.getGuild().getNation().getObjectUUID());
return nationCondemn == null || !nationCondemn.isActive() || nationCondemn.getFriendType() != Condemned.NATION;
return nationCondemn == null || !nationCondemn.active || nationCondemn.friendType != Condemned.NATION;
} else {
//TODO ADD ERRANT KOS CHECK
}