From 46b3db033bbde6ea9726e21543da2040d6dee369 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 20 Sep 2023 15:43:01 -0400 Subject: [PATCH] Inlined empty getters --- src/engine/Enum.java | 2 +- src/engine/InterestManagement/HeightMap.java | 19 ++- src/engine/db/archive/CityRecord.java | 2 +- src/engine/db/archive/MineRecord.java | 2 +- src/engine/db/archive/PvpRecord.java | 2 +- src/engine/db/handlers/dbZoneHandler.java | 12 +- src/engine/devcmd/cmds/AddMobCmd.java | 2 +- src/engine/devcmd/cmds/AuditMobsCmd.java | 6 +- src/engine/devcmd/cmds/GetHeightCmd.java | 12 +- src/engine/devcmd/cmds/GetOffsetCmd.java | 2 +- src/engine/devcmd/cmds/GetZoneCmd.java | 2 +- src/engine/devcmd/cmds/GotoCmd.java | 6 +- src/engine/devcmd/cmds/HotzoneCmd.java | 4 +- src/engine/devcmd/cmds/InfoCmd.java | 4 +- src/engine/devcmd/cmds/MakeBaneCmd.java | 4 +- src/engine/devcmd/cmds/PurgeObjectsCmd.java | 2 +- src/engine/devcmd/cmds/RealmInfoCmd.java | 6 +- src/engine/devcmd/cmds/RemoveBaneCmd.java | 4 +- src/engine/devcmd/cmds/RemoveObjectCmd.java | 2 +- src/engine/devcmd/cmds/SeaAuditCmd.java | 4 +- src/engine/devcmd/cmds/SetBaneActiveCmd.java | 4 +- .../devcmd/cmds/SetForceRenameCityCmd.java | 4 +- src/engine/devcmd/cmds/SummonCmd.java | 2 +- src/engine/devcmd/cmds/ZoneInfoCmd.java | 24 ++-- src/engine/devcmd/cmds/ZoneSetCmd.java | 2 +- src/engine/gameManager/LootManager.java | 2 +- src/engine/gameManager/MovementManager.java | 2 +- src/engine/gameManager/ZoneManager.java | 48 +++---- .../mobileAI/utilities/MovementUtilities.java | 4 +- src/engine/net/client/ClientMessagePump.java | 6 +- .../handlers/AbandonAssetMsgHandler.java | 2 +- .../handlers/AssetSupportMsgHandler.java | 2 +- .../handlers/ChannelMuteMsgHandler.java | 2 +- .../handlers/ClaimGuildTreeMsgHandler.java | 2 +- .../handlers/ManageCityAssetMsgHandler.java | 6 +- .../handlers/ObjectActionMsgHandler.java | 2 +- .../client/handlers/OrderNPCMsgHandler.java | 2 +- .../client/handlers/PlaceAssetMsgHandler.java | 44 +++--- .../handlers/RepairBuildingMsgHandler.java | 4 +- src/engine/net/client/msg/CityAssetMsg.java | 2 +- .../net/client/msg/GuildTreeStatusMsg.java | 4 +- .../net/client/msg/ManageCityAssetsMsg.java | 12 +- .../net/client/msg/ViewResourcesMessage.java | 2 +- .../objects/AbstractIntelligenceAgent.java | 2 +- src/engine/objects/Bane.java | 4 +- src/engine/objects/Building.java | 6 +- src/engine/objects/City.java | 10 +- src/engine/objects/ItemFactory.java | 4 +- src/engine/objects/Mine.java | 4 +- src/engine/objects/NPC.java | 4 +- src/engine/objects/PlayerCharacter.java | 30 ++-- src/engine/objects/Runegate.java | 2 +- src/engine/objects/Warehouse.java | 2 +- src/engine/objects/Zone.java | 129 ++++-------------- .../poweractions/SummonPowerAction.java | 2 +- src/engine/server/world/WorldServer.java | 4 +- src/engine/workthreads/DestroyCityThread.java | 4 +- src/engine/workthreads/HourlyJobThread.java | 4 +- 58 files changed, 210 insertions(+), 284 deletions(-) diff --git a/src/engine/Enum.java b/src/engine/Enum.java index 2510c2ac..b7b78c73 100644 --- a/src/engine/Enum.java +++ b/src/engine/Enum.java @@ -469,7 +469,7 @@ public class Enum { // 14001 does not have a banestone to bind at - if (ruinZone.getLoadNum() == 14001) + if (ruinZone.loadNum == 14001) spawnLocation = Vector3fImmutable.getRandomPointOnCircle(ruinZone.getLoc(), 30); else spawnLocation = Vector3fImmutable.getRandomPointOnCircle(ruinZone.getLoc() diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index 06813a46..06957997 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -154,8 +154,8 @@ public class HeightMap { this.heightMapID = 999999; this.maxHeight = 0; - int halfExtentsX = (int) zone.getBounds().getHalfExtents().x; - int halfExtentsY = (int) zone.getBounds().getHalfExtents().y; + int halfExtentsX = (int) zone.bounds.getHalfExtents().x; + int halfExtentsY = (int) zone.bounds.getHalfExtents().y; this.zoneLoadID = 0; this.seaLevel = 0; @@ -191,7 +191,7 @@ public class HeightMap { HeightMap heightMap = new HeightMap(zone); - HeightMap.heightmapByLoadNum.put(zone.getLoadNum(), heightMap); + HeightMap.heightmapByLoadNum.put(zone.loadNum, heightMap); } @@ -206,7 +206,7 @@ public class HeightMap { return zone; while (nextZone.getHeightMap() == null) - nextZone = nextZone.getParent(); + nextZone = nextZone.parent; return nextZone; } @@ -247,9 +247,14 @@ public class HeightMap { } private static float interpolatePLANAR(Vector3fImmutable worldLoc, Zone heightMapZone, Vector2f zoneLoc, float interpolatedTerrainHeight) { + + // zones of type PLANAR + Zone parentZone; float interpolatedParentTerrainHeight; - parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.getParent()); + + parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.parent); + interpolatedParentTerrainHeight = HeightMap.getWorldHeight(parentZone, worldLoc); interpolatedParentTerrainHeight += parentZone.worldAltitude; @@ -263,8 +268,8 @@ public class HeightMap { (heightMapZone.maxBlend.getHalfExtents().y); float currentArea = (blendBounds.getHalfExtents().x) * (blendBounds.getHalfExtents().y); - float zoneArea = (heightMapZone.getBounds().getHalfExtents().x) * - (heightMapZone.getBounds().getHalfExtents().y); + float zoneArea = (heightMapZone.bounds.getHalfExtents().x) * + (heightMapZone.bounds.getHalfExtents().y); blendBounds.release(); diff --git a/src/engine/db/archive/CityRecord.java b/src/engine/db/archive/CityRecord.java index 099ddf7d..f8a0e9c2 100644 --- a/src/engine/db/archive/CityRecord.java +++ b/src/engine/db/archive/CityRecord.java @@ -67,7 +67,7 @@ public class CityRecord extends DataRecord { cityRecord.locX = cityRecord.city.getTOL().getLoc().x; cityRecord.locY = -cityRecord.city.getTOL().getLoc().z; // flip sign on 'y' coordinate - cityRecord.zoneHash = cityRecord.city.getParent().getHash(); + cityRecord.zoneHash = cityRecord.city.getParent().hash; if (cityRecord.eventType.equals(Enum.RecordEventType.CREATE)) cityRecord.establishedDatetime = cityRecord.city.established; diff --git a/src/engine/db/archive/MineRecord.java b/src/engine/db/archive/MineRecord.java index 25c151bd..ee67a24c 100644 --- a/src/engine/db/archive/MineRecord.java +++ b/src/engine/db/archive/MineRecord.java @@ -52,7 +52,7 @@ public class MineRecord extends DataRecord { mineRecord.eventType = eventType; } - mineRecord.zoneHash = mine.getParentZone().getHash(); + mineRecord.zoneHash = mine.getParentZone().hash; if (character.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { player = (PlayerCharacter) character; diff --git a/src/engine/db/archive/PvpRecord.java b/src/engine/db/archive/PvpRecord.java index bfe3652e..e90a8832 100644 --- a/src/engine/db/archive/PvpRecord.java +++ b/src/engine/db/archive/PvpRecord.java @@ -281,7 +281,7 @@ public class PvpRecord extends DataRecord { outStatement.setInt(8, this.victim.getLevel()); outStatement.setString(9, DataWarehouse.hasher.encrypt(zone.getObjectUUID())); - outStatement.setString(10, zone.getName()); + outStatement.setString(10, zone.zoneName); outStatement.setFloat(11, this.location.getX()); outStatement.setFloat(12, -this.location.getZ()); // flip sign on 'y' coordinate outStatement.setBoolean(13, this.pvpExp); diff --git a/src/engine/db/handlers/dbZoneHandler.java b/src/engine/db/handlers/dbZoneHandler.java index 84abc1a7..c367d22e 100644 --- a/src/engine/db/handlers/dbZoneHandler.java +++ b/src/engine/db/handlers/dbZoneHandler.java @@ -33,18 +33,18 @@ public class dbZoneHandler extends dbHandlerBase { ArrayList wsmList = new ArrayList<>(); wsmList.addAll(zone.getNodes()); if (zone.absX == 0.0f) { - zone.absX = zone.getXCoord(); + zone.absX = zone.xCoord; } if (zone.absY == 0.0f) { - zone.absY = zone.getYCoord(); + zone.absY = zone.yCoord; } if (zone.absZ == 0.0f) { - zone.absZ = zone.getZCoord(); + zone.absZ = zone.zCoord; } for (Zone child : zone.getNodes()) { - child.absX = child.getXCoord() + zone.absX; - child.absY = child.getYCoord() + zone.absY; - child.absZ = child.getZCoord() + zone.absZ; + child.absX = child.xCoord + zone.absX; + child.absY = child.yCoord + zone.absY; + child.absZ = child.zCoord + zone.absZ; wsmList.addAll(this.GET_ALL_NODES(child)); } return wsmList; diff --git a/src/engine/devcmd/cmds/AddMobCmd.java b/src/engine/devcmd/cmds/AddMobCmd.java index 59e0f7e7..30fbac56 100644 --- a/src/engine/devcmd/cmds/AddMobCmd.java +++ b/src/engine/devcmd/cmds/AddMobCmd.java @@ -78,7 +78,7 @@ public class AddMobCmd extends AbstractDevCmd { return; } - if (zone.isPlayerCity()) { + if (zone.isPlayerCity) { throwbackError(pc, "Cannot use ./mob on Player cities. Try ./servermob instead."); return; } diff --git a/src/engine/devcmd/cmds/AuditMobsCmd.java b/src/engine/devcmd/cmds/AuditMobsCmd.java index d8586911..42a22506 100644 --- a/src/engine/devcmd/cmds/AuditMobsCmd.java +++ b/src/engine/devcmd/cmds/AuditMobsCmd.java @@ -40,8 +40,8 @@ public class AuditMobsCmd extends AbstractDevCmd { if (size >= count) { plusplus++; - throwbackInfo(pcSender, zoneMicro.getName() + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. "); - System.out.println(zoneMicro.getName() + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. "); + throwbackInfo(pcSender, zoneMicro.zoneName + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. "); + System.out.println(zoneMicro.zoneName + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. "); } @@ -80,7 +80,7 @@ public class AuditMobsCmd extends AbstractDevCmd { //ConcurrentHashMap respawnMap = Mob.getRespawnMap(); // ConcurrentHashMap despawnMap = Mob.getDespawnMap(); - throwbackInfo(pcSender, zone.getName() + ", numMobs: " + zone.zoneMobSet.size()); + throwbackInfo(pcSender, zone.zoneName + ", numMobs: " + zone.zoneMobSet.size()); throwbackInfo(pcSender, "UUID, dbID, inRespawnMap, isAlive, activeAI, Loc"); diff --git a/src/engine/devcmd/cmds/GetHeightCmd.java b/src/engine/devcmd/cmds/GetHeightCmd.java index df8331a5..29792691 100644 --- a/src/engine/devcmd/cmds/GetHeightCmd.java +++ b/src/engine/devcmd/cmds/GetHeightCmd.java @@ -34,7 +34,7 @@ public class GetHeightCmd extends AbstractDevCmd { currentZone = ZoneManager.findSmallestZone(playerCharacter.getLoc()); heightmapZone = HeightMap.getNextZoneWithTerrain(currentZone); - parentZone = HeightMap.getNextZoneWithTerrain(currentZone.getParent()); + parentZone = HeightMap.getNextZoneWithTerrain(currentZone.parent); float currentHeight = HeightMap.getWorldHeight(currentZone, playerCharacter.getLoc()); float parentHeight = HeightMap.getWorldHeight(parentZone, playerCharacter.getLoc()); @@ -42,17 +42,17 @@ public class GetHeightCmd extends AbstractDevCmd { Vector2f zoneLoc = ZoneManager.worldToZoneSpace(playerCharacter.getLoc(), heightmapZone); Vector2f gridSquare = heightmapZone.getHeightMap().getGridSquare(zoneLoc); - this.throwbackInfo(playerCharacter, "Current Zone : " + currentZone.getName()); - this.throwbackInfo(playerCharacter, "Heightmap Zone : " + heightmapZone.getName()); + this.throwbackInfo(playerCharacter, "Current Zone : " + currentZone.zoneName); + this.throwbackInfo(playerCharacter, "Heightmap Zone : " + heightmapZone.zoneName); this.throwbackInfo(playerCharacter, "Zone Height: " + heightmapZone.worldAltitude); - this.throwbackInfo(playerCharacter, "Sea Level: " + heightmapZone.getSeaLevel()); - this.throwbackInfo(playerCharacter, "Drowning Height: " + (heightmapZone.getSeaLevel() + playerCharacter.getCharacterHeight())); + this.throwbackInfo(playerCharacter, "Sea Level: " + heightmapZone.seaLevel); + this.throwbackInfo(playerCharacter, "Drowning Height: " + (heightmapZone.seaLevel + playerCharacter.getCharacterHeight())); this.throwbackInfo(playerCharacter, "Grid : " + (int) gridSquare.x + "x" + (int) gridSquare.y); this.throwbackInfo(playerCharacter, "*** 256: " + currentHeight); this.throwbackInfo(playerCharacter, "***Adjusted Height: " + (currentHeight + playerCharacter.getCharacterHeight())); this.throwbackInfo(playerCharacter, "------------"); - this.throwbackInfo(playerCharacter, "Parent : " + parentZone.getName()); + this.throwbackInfo(playerCharacter, "Parent : " + parentZone.zoneName); this.throwbackInfo(playerCharacter, "Height returned : " + parentHeight); this.throwbackInfo(playerCharacter, "------------"); diff --git a/src/engine/devcmd/cmds/GetOffsetCmd.java b/src/engine/devcmd/cmds/GetOffsetCmd.java index 46c75b14..2330a8b1 100644 --- a/src/engine/devcmd/cmds/GetOffsetCmd.java +++ b/src/engine/devcmd/cmds/GetOffsetCmd.java @@ -48,7 +48,7 @@ public class GetOffsetCmd extends AbstractDevCmd { float difY = pcSender.getLoc().y - zone.absY; float difZ = pcSender.getLoc().z - zone.absZ; - throwbackInfo(pcSender, zone.getName() + ": (x: " + difX + ", y: " + difY + ", z: " + difZ + ')'); + throwbackInfo(pcSender, zone.zoneName + ": (x: " + difX + ", y: " + difY + ", z: " + difZ + ')'); } @Override diff --git a/src/engine/devcmd/cmds/GetZoneCmd.java b/src/engine/devcmd/cmds/GetZoneCmd.java index dc7c3693..a2deba81 100644 --- a/src/engine/devcmd/cmds/GetZoneCmd.java +++ b/src/engine/devcmd/cmds/GetZoneCmd.java @@ -51,7 +51,7 @@ public class GetZoneCmd extends AbstractDevCmd { } for (Zone zone : allIn) - throwbackInfo(pcSender, zone.getName() + "; UUID: " + zone.getObjectUUID() + ", loadNum: " + zone.getLoadNum()); + throwbackInfo(pcSender, zone.zoneName + "; UUID: " + zone.getObjectUUID() + ", loadNum: " + zone.loadNum); } @Override diff --git a/src/engine/devcmd/cmds/GotoCmd.java b/src/engine/devcmd/cmds/GotoCmd.java index 95ab5f93..e2864d82 100644 --- a/src/engine/devcmd/cmds/GotoCmd.java +++ b/src/engine/devcmd/cmds/GotoCmd.java @@ -81,7 +81,7 @@ public class GotoCmd extends AbstractDevCmd { continue; Zone zone = city.getParent(); if (zone != null) { - if (zone.isNPCCity() || zone.isPlayerCity()) + if (zone.isNPCCity || zone.isPlayerCity) loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS); else loc = zone.getLoc(); @@ -97,10 +97,10 @@ public class GotoCmd extends AbstractDevCmd { Zone zone = (Zone) zoneAgo; if (zone == null) continue; - if (!zone.getName().equalsIgnoreCase(cityName)) + if (!zone.zoneName.equalsIgnoreCase(cityName)) continue; if (zone != null) { - if (zone.isNPCCity() || zone.isPlayerCity()) + if (zone.isNPCCity || zone.isPlayerCity) loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS); else loc = zone.getLoc(); diff --git a/src/engine/devcmd/cmds/HotzoneCmd.java b/src/engine/devcmd/cmds/HotzoneCmd.java index 2aa88f14..67db790f 100644 --- a/src/engine/devcmd/cmds/HotzoneCmd.java +++ b/src/engine/devcmd/cmds/HotzoneCmd.java @@ -40,7 +40,7 @@ public class HotzoneCmd extends AbstractDevCmd { String input = data.toString().trim(); if (input.length() == 0) { - outString = "Current hotZone: " + ZoneManager.hotZone.getName() + "\r\n"; + outString = "Current hotZone: " + ZoneManager.hotZone.zoneName + "\r\n"; outString += "Available hotZones: " + ZoneManager.availableHotZones(); throwbackInfo(playerCharacter, outString); return; @@ -48,7 +48,7 @@ public class HotzoneCmd extends AbstractDevCmd { if (input.equalsIgnoreCase("random")) { ZoneManager.generateAndSetRandomHotzone(); - outString = "New hotZone: " + ZoneManager.hotZone.getName() + "\r\n"; + outString = "New hotZone: " + ZoneManager.hotZone.zoneName + "\r\n"; outString += "Available hotZones: " + ZoneManager.availableHotZones(); throwbackInfo(playerCharacter, outString); return; diff --git a/src/engine/devcmd/cmds/InfoCmd.java b/src/engine/devcmd/cmds/InfoCmd.java index 51edb93a..34bb73e2 100644 --- a/src/engine/devcmd/cmds/InfoCmd.java +++ b/src/engine/devcmd/cmds/InfoCmd.java @@ -387,7 +387,7 @@ public class InfoCmd extends AbstractDevCmd { output += newline; output += "EquipSet: " + targetNPC.getEquipmentSetID(); output += newline; - output += "Parent Zone LoadNum : " + targetNPC.getParentZone().getLoadNum(); + output += "Parent Zone LoadNum : " + targetNPC.getParentZone().loadNum; } @@ -473,7 +473,7 @@ public class InfoCmd extends AbstractDevCmd { output += "EquipSet: " + targetMob.equipmentSetID; output += newline; try { - output += "Parent Zone LoadNum : " + targetMob.getParentZone().getLoadNum(); + output += "Parent Zone LoadNum : " + targetMob.getParentZone().loadNum; } catch (Exception ex) { //who cares } diff --git a/src/engine/devcmd/cmds/MakeBaneCmd.java b/src/engine/devcmd/cmds/MakeBaneCmd.java index e4328ec0..17f82685 100644 --- a/src/engine/devcmd/cmds/MakeBaneCmd.java +++ b/src/engine/devcmd/cmds/MakeBaneCmd.java @@ -111,12 +111,12 @@ public class MakeBaneCmd extends AbstractDevCmd { return; } - if (!zone.isPlayerCity()) { + if (!zone.isPlayerCity) { throwbackError(pc, "This is not a player city."); return; } - City city = City.getCity(zone.getPlayerCityUUID()); + City city = City.getCity(zone.playerCityID); if (city == null) { throwbackError(pc, "Unable to find the city associated with this zone."); return; diff --git a/src/engine/devcmd/cmds/PurgeObjectsCmd.java b/src/engine/devcmd/cmds/PurgeObjectsCmd.java index 74922c07..deb30cd8 100644 --- a/src/engine/devcmd/cmds/PurgeObjectsCmd.java +++ b/src/engine/devcmd/cmds/PurgeObjectsCmd.java @@ -42,7 +42,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd { private static void PurgeWalls(Zone zone, PlayerCharacter pc) { - if (!zone.isPlayerCity()) + if (!zone.isPlayerCity) return; for (Building building : zone.zoneBuildingSet) { diff --git a/src/engine/devcmd/cmds/RealmInfoCmd.java b/src/engine/devcmd/cmds/RealmInfoCmd.java index 21c29e8d..916e51a6 100644 --- a/src/engine/devcmd/cmds/RealmInfoCmd.java +++ b/src/engine/devcmd/cmds/RealmInfoCmd.java @@ -60,12 +60,12 @@ public class RealmInfoCmd extends AbstractDevCmd { outString += ")"; outString += newline; - outString += " Zone: " + serverZone.getName(); + outString += " Zone: " + serverZone.zoneName; outString += newline; - if (serverZone.getParent() != null) - outString += " Parent: " + serverZone.getParent().getName(); + if (serverZone.parent != null) + outString += " Parent: " + serverZone.parent.zoneName; else outString += "Parent: NONE"; diff --git a/src/engine/devcmd/cmds/RemoveBaneCmd.java b/src/engine/devcmd/cmds/RemoveBaneCmd.java index 31994552..0e760f50 100644 --- a/src/engine/devcmd/cmds/RemoveBaneCmd.java +++ b/src/engine/devcmd/cmds/RemoveBaneCmd.java @@ -34,12 +34,12 @@ public class RemoveBaneCmd extends AbstractDevCmd { return; } - if (!zone.isPlayerCity()) { + if (!zone.isPlayerCity) { throwbackError(pc, "This is not a player city."); return; } - City city = City.getCity(zone.getPlayerCityUUID()); + City city = City.getCity(zone.playerCityID); if (city == null) { throwbackError(pc, "Unable to find the city associated with this zone."); return; diff --git a/src/engine/devcmd/cmds/RemoveObjectCmd.java b/src/engine/devcmd/cmds/RemoveObjectCmd.java index 6f7ac8f0..19a9fd2c 100644 --- a/src/engine/devcmd/cmds/RemoveObjectCmd.java +++ b/src/engine/devcmd/cmds/RemoveObjectCmd.java @@ -130,7 +130,7 @@ public class RemoveObjectCmd extends AbstractDevCmd { building.disableSpire(false); if ((building.getBlueprint() != null) && (building.getBlueprint().getBuildingGroup() == BuildingGroup.WAREHOUSE)) { - City city = City.getCity(building.getParentZone().getPlayerCityUUID()); + City city = City.getCity(building.getParentZone().playerCityID); if (city != null) { city.setWarehouseBuildingID(0); } diff --git a/src/engine/devcmd/cmds/SeaAuditCmd.java b/src/engine/devcmd/cmds/SeaAuditCmd.java index 5ec6a40f..f5cdbdde 100644 --- a/src/engine/devcmd/cmds/SeaAuditCmd.java +++ b/src/engine/devcmd/cmds/SeaAuditCmd.java @@ -26,8 +26,8 @@ public class SeaAuditCmd extends AbstractDevCmd { AbstractGameObject target) { for (Zone zone : ZoneManager.getAllZones()) - if (zone.getSeaLevel() > zone.worldAltitude) - this.throwbackInfo(playerCharacter, zone.getObjectUUID() + zone.getName()); + if (zone.seaLevel > zone.worldAltitude) + this.throwbackInfo(playerCharacter, zone.getObjectUUID() + zone.zoneName); } @Override diff --git a/src/engine/devcmd/cmds/SetBaneActiveCmd.java b/src/engine/devcmd/cmds/SetBaneActiveCmd.java index eb24655b..e7c0ba56 100644 --- a/src/engine/devcmd/cmds/SetBaneActiveCmd.java +++ b/src/engine/devcmd/cmds/SetBaneActiveCmd.java @@ -41,12 +41,12 @@ public class SetBaneActiveCmd extends AbstractDevCmd { return; } - if (!zone.isPlayerCity()) { + if (!zone.isPlayerCity) { throwbackError(pc, "This is not a player city."); return; } - City city = City.getCity(zone.getPlayerCityUUID()); + City city = City.getCity(zone.playerCityID); if (city == null) { throwbackError(pc, "Unable to find the city associated with this zone."); return; diff --git a/src/engine/devcmd/cmds/SetForceRenameCityCmd.java b/src/engine/devcmd/cmds/SetForceRenameCityCmd.java index 3fded48b..5b275697 100644 --- a/src/engine/devcmd/cmds/SetForceRenameCityCmd.java +++ b/src/engine/devcmd/cmds/SetForceRenameCityCmd.java @@ -31,9 +31,9 @@ public class SetForceRenameCityCmd extends AbstractDevCmd { if (zone == null) return; boolean rename = words[0].equalsIgnoreCase("true") ? true : false; - if (zone.getPlayerCityUUID() == 0) + if (zone.playerCityID == 0) return; - City city = City.getCity(zone.getPlayerCityUUID()); + City city = City.getCity(zone.playerCityID); if (city == null) return; city.setForceRename(rename); diff --git a/src/engine/devcmd/cmds/SummonCmd.java b/src/engine/devcmd/cmds/SummonCmd.java index 184903ca..6877db2c 100644 --- a/src/engine/devcmd/cmds/SummonCmd.java +++ b/src/engine/devcmd/cmds/SummonCmd.java @@ -40,7 +40,7 @@ public class SummonCmd extends AbstractDevCmd { Zone zone = ZoneManager.findSmallestZone(pc.getLoc()); String location = "Somewhere"; if (zone != null) - location = zone.getName(); + location = zone.zoneName; RecvSummonsRequestMsg rsrm = new RecvSummonsRequestMsg(pc.getObjectType().ordinal(), pc.getObjectUUID(), pc.getFirstName(), location, false); toSummon.getClientConnection().sendMsg(rsrm); diff --git a/src/engine/devcmd/cmds/ZoneInfoCmd.java b/src/engine/devcmd/cmds/ZoneInfoCmd.java index 6a1daa3d..17d1226a 100644 --- a/src/engine/devcmd/cmds/ZoneInfoCmd.java +++ b/src/engine/devcmd/cmds/ZoneInfoCmd.java @@ -73,21 +73,21 @@ public class ZoneInfoCmd extends AbstractDevCmd { output = "Target Information:" + newline; output += StringUtils.addWS("UUID: " + objectUUID, 20); output += newline; - output += "name: " + zone.getName(); + output += "name: " + zone.zoneName; output += newline; - output += "loadNum: " + zone.getLoadNum(); - if (zone.getParent() != null) { - output += StringUtils.addWS(", parent: " + zone.getParent().getObjectUUID(), 30); - output += "Parentabs: x: " + zone.getParent().getAbsX() + ", y: " + zone.getParent().getAbsY() + ", z: " + zone.getParent().getAbsZ(); + output += "loadNum: " + zone.loadNum; + if (zone.parent != null) { + output += StringUtils.addWS(", parent: " + zone.parent.getObjectUUID(), 30); + output += "Parentabs: x: " + zone.parent.absX + ", y: " + zone.parent.absY + ", z: " + zone.parent.absZ; } else output += StringUtils.addWS(", parent: none", 30); output += newline; - output += "absLoc: x: " + zone.getAbsX() + ", y: " + zone.getAbsY() + ", z: " + zone.getAbsZ(); + output += "absLoc: x: " + zone.absX + ", y: " + zone.absY + ", z: " + zone.absZ; output += newline; - output += "offset: x: " + zone.getXCoord() + ", y: " + zone.getYCoord() + ", z: " + zone.getZCoord(); + output += "offset: x: " + zone.xCoord + ", y: " + zone.yCoord + ", z: " + zone.zCoord; output += newline; - output += "radius: x: " + zone.getBounds().getHalfExtents().x + ", z: " + zone.getBounds().getHalfExtents().y; + output += "radius: x: " + zone.bounds.getHalfExtents().x + ", z: " + zone.bounds.getHalfExtents().y; output += newline; if (zone.getHeightMap() != null) { @@ -98,11 +98,11 @@ public class ZoneInfoCmd extends AbstractDevCmd { output += "Bucket Width Y : " + zone.getHeightMap().bucketWidthY; } - output += "radius: x: " + zone.getBounds().getHalfExtents().x + ", z: " + zone.getBounds().getHalfExtents().y; + output += "radius: x: " + zone.bounds.getHalfExtents().x + ", z: " + zone.bounds.getHalfExtents().y; output += newline; // output += "minLvl = " + zone.getMinLvl() + " | maxLvl = " + zone.getMaxLvl(); output += newline; - output += "Sea Level = " + zone.getSeaLevel(); + output += "Sea Level = " + zone.seaLevel; output += newline; output += "World Altitude = " + zone.worldAltitude; throwbackInfo(player, output); @@ -110,7 +110,7 @@ public class ZoneInfoCmd extends AbstractDevCmd { City city = ZoneManager.getCityAtLocation(player.getLoc()); output += newline; - output += (city == null) ? "None" : city.getParent().getName(); + output += (city == null) ? "None" : city.getParent().zoneName; if (city != null) { @@ -130,7 +130,7 @@ public class ZoneInfoCmd extends AbstractDevCmd { for (Zone child : nodes) { output += newline; - output += child.getName() + " (" + child.getLoadNum() + ')'; + output += child.zoneName + " (" + child.loadNum + ')'; } } throwbackInfo(player, output); diff --git a/src/engine/devcmd/cmds/ZoneSetCmd.java b/src/engine/devcmd/cmds/ZoneSetCmd.java index 2d6b3a56..9da9cbbd 100644 --- a/src/engine/devcmd/cmds/ZoneSetCmd.java +++ b/src/engine/devcmd/cmds/ZoneSetCmd.java @@ -40,7 +40,7 @@ public class ZoneSetCmd extends AbstractDevCmd { zone = ZoneManager.findSmallestZone(playerCharacter.getLoc()); - throwbackInfo(playerCharacter, zone.getName() + " (" + zone.getLoadNum() + ") " + zone.getObjectUUID()); + throwbackInfo(playerCharacter, zone.zoneName + " (" + zone.loadNum + ") " + zone.getObjectUUID()); // NPC diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 96d699b4..16409aaf 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -86,7 +86,7 @@ public enum LootManager { if(ib == null) break; if (ib.isDiscRune() || ib.getName().toLowerCase().contains("of the gods")) { - ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?"); + ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + ib.getName() + ". Are you tough enough to take it?"); chatMsg.setMessageType(10); chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); DispatchMessage.dispatchMsgToAll(chatMsg); diff --git a/src/engine/gameManager/MovementManager.java b/src/engine/gameManager/MovementManager.java index 6bc4ced5..c8f3569e 100644 --- a/src/engine/gameManager/MovementManager.java +++ b/src/engine/gameManager/MovementManager.java @@ -267,7 +267,7 @@ public enum MovementManager { Zone serverZone = null; serverZone = ZoneManager.findSmallestZone(player.getLoc()); - cityObject = (City) DbManager.getFromCache(GameObjectType.City, serverZone.getPlayerCityUUID()); + cityObject = (City) DbManager.getFromCache(GameObjectType.City, serverZone.playerCityID); // Do not send group messages if player is on grid diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index 8da4ee9e..77ecd6a7 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -61,8 +61,8 @@ public enum ZoneManager { if (zone != null) { allIn.add(zone); - while (zone.getParent() != null) { - zone = zone.getParent(); + while (zone.parent != null) { + zone = zone.parent; allIn.add(zone); } } @@ -90,7 +90,7 @@ public enum ZoneManager { if (nodes != null) for (Zone child : nodes) { - if (Bounds.collide(loc, child.getBounds()) == true) { + if (Bounds.collide(loc, child.bounds) == true) { zone = child; childFound = true; break; @@ -106,7 +106,7 @@ public enum ZoneManager { ZoneManager.zonesByUUID.put(zone.getObjectUUID(), zone); - ZoneManager.zonesByName.put(zone.getName().toLowerCase(), zone); + ZoneManager.zonesByName.put(zone.zoneName.toLowerCase(), zone); } @@ -169,7 +169,7 @@ public enum ZoneManager { if (ZoneManager.hotZone == null) return false; - return (Bounds.collide(loc, ZoneManager.hotZone.getBounds()) == true); + return (Bounds.collide(loc, ZoneManager.hotZone.bounds) == true); } public static Zone getSeaFloor() { @@ -182,7 +182,7 @@ public enum ZoneManager { public static final void populateWorldZones(final Zone zone) { - int loadNum = zone.getLoadNum(); + int loadNum = zone.loadNum; // Zones are added to separate // collections for quick access @@ -194,12 +194,12 @@ public enum ZoneManager { } - if (zone.isPlayerCity()) { + if (zone.isPlayerCity) { addPlayerCityZone(zone); return; } - if (zone.isNPCCity()) + if (zone.isNPCCity) addNPCCityZone(zone); } @@ -209,12 +209,12 @@ public enum ZoneManager { } private static void addNPCCityZone(final Zone zone) { - zone.setNPCCity(true); + zone.isNPCCity = true; ZoneManager.npcCityZones.add(zone); } public static final void addPlayerCityZone(final Zone zone) { - zone.setPlayerCity(true); + zone.isPlayerCity = true; ZoneManager.playerCityZones.add(zone); } @@ -250,7 +250,7 @@ public enum ZoneManager { public static final boolean validHotZone(Zone zone) { - if (zone.getSafeZone() == (byte) 1) + if (zone.peaceZone == (byte) 1) return false; // no safe zone hotzones// if (this.hotzone == null) if (zone.getNodes().isEmpty()) @@ -298,14 +298,14 @@ public enum ZoneManager { // Top left corner of zone is calculated in world space by the center and it's extents. zoneOrigin = new Vector2f(serverZone.getLoc().x, serverZone.getLoc().z); - zoneOrigin = zoneOrigin.subtract(new Vector2f(serverZone.getBounds().getHalfExtents().x, serverZone.getBounds().getHalfExtents().y)); + zoneOrigin = zoneOrigin.subtract(new Vector2f(serverZone.bounds.getHalfExtents().x, serverZone.bounds.getHalfExtents().y)); // Local coordinate in world space translated to an offset from the calculated zone origin. localCoords = new Vector2f(worldVector.x, worldVector.z); localCoords = localCoords.subtract(zoneOrigin); - localCoords.setY((serverZone.getBounds().getHalfExtents().y * 2) - localCoords.y); + localCoords.setY((serverZone.bounds.getHalfExtents().y * 2) - localCoords.y); // TODO : Make sure this value does not go outside the zone's bounds. @@ -387,8 +387,8 @@ public enum ZoneManager { currentZone = ZoneManager.findSmallestZone(worldLoc); - if (currentZone.isPlayerCity()) - return City.getCity(currentZone.getPlayerCityUUID()); + if (currentZone.isPlayerCity) + return City.getCity(currentZone.playerCityID); return null; } @@ -420,7 +420,7 @@ public enum ZoneManager { if (zone.isContinent()) continue; - if (Bounds.collide(treeBounds, zone.getBounds(), 0.0f)) + if (Bounds.collide(treeBounds, zone.bounds, 0.0f)) validLocation = false; } @@ -440,8 +440,8 @@ public enum ZoneManager { //not player city, must be npc city.. - if (!zone.isPlayerCity()) - zone.setNPCCity(true); + if (!zone.isPlayerCity) + zone.isNPCCity = true; if ((ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER)) && (city.getHash() == null)) { @@ -461,15 +461,15 @@ public enum ZoneManager { // Seafloor - if (zone.getParent() == null) + if (zone.parent == null) return worldAlttitude; - Zone parentZone = zone.getParent(); + Zone parentZone = zone.parent; // Children of seafloor - if (parentZone.getParent() == null) - return worldAlttitude + zone.getYCoord(); + if (parentZone.parent == null) + return worldAlttitude + zone.yCoord; // return height from heightmap engine at zone location @@ -477,7 +477,7 @@ public enum ZoneManager { // Add zone offset to value - worldAlttitude += zone.getYCoord(); + worldAlttitude += zone.yCoord; return worldAlttitude; } @@ -487,6 +487,6 @@ public enum ZoneManager { float localAltitude = HeightMap.getWorldHeight(currentLoc); Zone zone = findSmallestZone(currentLoc); - return localAltitude < zone.getSeaLevel(); + return localAltitude < zone.seaLevel; } } diff --git a/src/engine/mobileAI/utilities/MovementUtilities.java b/src/engine/mobileAI/utilities/MovementUtilities.java index 63a6982b..c00bfffa 100644 --- a/src/engine/mobileAI/utilities/MovementUtilities.java +++ b/src/engine/mobileAI/utilities/MovementUtilities.java @@ -68,8 +68,8 @@ public class MovementUtilities { float zoneRange = 250; if (agent.getParentZone() != null) { - if (agent.getParentZone().getBounds() != null) - zoneRange = agent.getParentZone().getBounds().getHalfExtents().x * 2; + if (agent.getParentZone().bounds != null) + zoneRange = agent.getParentZone().bounds.getHalfExtents().x * 2; } if (zoneRange > 300) diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index 14f62c3b..8086ef33 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -1196,7 +1196,7 @@ public class ClientMessagePump implements NetMsgHandler { if (npc.getCharItemManager().getInventoryCount() > 150) { - if (npc.getParentZone() != null && npc.getParentZone().getPlayerCityUUID() == 0) { + if (npc.getParentZone() != null && npc.getParentZone().playerCityID == 0) { ArrayList inv = npc.getInventory(); for (int i = 0; i < 20; i++) { try { @@ -1229,7 +1229,7 @@ public class ClientMessagePump implements NetMsgHandler { if (ib == null) return; - if (npc.getParentZone() != null && npc.getParentZone().getPlayerCityUUID() != 0) + if (npc.getParentZone() != null && npc.getParentZone().playerCityID != 0) if (!npc.getCharItemManager().hasRoomInventory(ib.getWeight())) { ErrorPopupMsg.sendErrorPopup(player, 21); @@ -1280,7 +1280,7 @@ public class ClientMessagePump implements NetMsgHandler { if (building != null && building.getProtectionState().equals(ProtectionState.NPC)) building = null; - if (npc.getParentZone().getPlayerCityUUID() == 0) + if (npc.getParentZone().playerCityID == 0) building = null; //make sure npc can afford item diff --git a/src/engine/net/client/handlers/AbandonAssetMsgHandler.java b/src/engine/net/client/handlers/AbandonAssetMsgHandler.java index 168afbf0..8774242d 100644 --- a/src/engine/net/client/handlers/AbandonAssetMsgHandler.java +++ b/src/engine/net/client/handlers/AbandonAssetMsgHandler.java @@ -151,7 +151,7 @@ public class AbandonAssetMsgHandler extends AbstractClientMsgHandler { cityZone = ZoneManager.findSmallestZone(targetBuilding.getLoc()); // Can't abandon a tree not within a player city zone - if (cityZone.isPlayerCity() == false) + if (cityZone.isPlayerCity == false) return; if (targetBuilding.getCity() == null) diff --git a/src/engine/net/client/handlers/AssetSupportMsgHandler.java b/src/engine/net/client/handlers/AssetSupportMsgHandler.java index d7bcc3d3..0f4439ae 100644 --- a/src/engine/net/client/handlers/AssetSupportMsgHandler.java +++ b/src/engine/net/client/handlers/AssetSupportMsgHandler.java @@ -45,7 +45,7 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler { if (serverZone == null) return; - serverCity = City.GetCityFromCache(serverZone.getPlayerCityUUID()); + serverCity = City.GetCityFromCache(serverZone.playerCityID); if (serverCity == null) return; diff --git a/src/engine/net/client/handlers/ChannelMuteMsgHandler.java b/src/engine/net/client/handlers/ChannelMuteMsgHandler.java index 71d40686..30a003fc 100644 --- a/src/engine/net/client/handlers/ChannelMuteMsgHandler.java +++ b/src/engine/net/client/handlers/ChannelMuteMsgHandler.java @@ -65,7 +65,7 @@ public class ChannelMuteMsgHandler extends AbstractClientMsgHandler { cityZone = ZoneManager.findSmallestZone(targetBuilding.getLoc()); // Can't abandon a tree not within a player city zone - if (cityZone.isPlayerCity() == false) + if (cityZone.isPlayerCity == false) return; if (targetBuilding.getCity().hasBeenTransfered == true) { diff --git a/src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java b/src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java index 23570e45..c942f40c 100644 --- a/src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java +++ b/src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java @@ -69,7 +69,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler { playerZone = building.getParentZone(); if (playerZone != null) - playerCity = City.getCity(playerZone.getPlayerCityUUID()); + playerCity = City.getCity(playerZone.playerCityID); // Oops! *** Refactor: Log error switch (msg.getMessageType()) { diff --git a/src/engine/net/client/handlers/ManageCityAssetMsgHandler.java b/src/engine/net/client/handlers/ManageCityAssetMsgHandler.java index e2b0af01..0f55d6a0 100644 --- a/src/engine/net/client/handlers/ManageCityAssetMsgHandler.java +++ b/src/engine/net/client/handlers/ManageCityAssetMsgHandler.java @@ -75,12 +75,12 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { Zone zone = ZoneManager.findSmallestZone(player.getLoc()); - if (!zone.isPlayerCity()) { + if (!zone.isPlayerCity) { ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command."); return true; } - City city = City.GetCityFromCache(zone.getPlayerCityUUID()); + City city = City.GetCityFromCache(zone.playerCityID); if (city == null) { ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command."); @@ -254,7 +254,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { if (baneZone == null) return true; - City banedCity = City.getCity(baneZone.getPlayerCityUUID()); + City banedCity = City.getCity(baneZone.playerCityID); if (banedCity == null) return true; diff --git a/src/engine/net/client/handlers/ObjectActionMsgHandler.java b/src/engine/net/client/handlers/ObjectActionMsgHandler.java index d6ef538e..1ffba79c 100644 --- a/src/engine/net/client/handlers/ObjectActionMsgHandler.java +++ b/src/engine/net/client/handlers/ObjectActionMsgHandler.java @@ -334,7 +334,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { Zone zone = ZoneManager.findSmallestZone(player.getLoc()); if (zone != null) { - if (zone.isPlayerCity()) { + if (zone.isPlayerCity) { loc = zone.getLoc(); } } diff --git a/src/engine/net/client/handlers/OrderNPCMsgHandler.java b/src/engine/net/client/handlers/OrderNPCMsgHandler.java index e26933ab..3de83fee 100644 --- a/src/engine/net/client/handlers/OrderNPCMsgHandler.java +++ b/src/engine/net/client/handlers/OrderNPCMsgHandler.java @@ -288,7 +288,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { if (zone == null) return false; - if (zone.getPlayerCityUUID() == 0) + if (zone.playerCityID == 0) return false; City city = building.getCity(); diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index 3abbb6f2..773bdc81 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -137,7 +137,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { private static boolean validateBuildingPlacement(Zone serverZone, PlaceAssetMsg msg, ClientConnection origin, PlayerCharacter player, PlacementInfo placementInfo) { - if (serverZone.isPlayerCity() == false) { + if (serverZone.isPlayerCity == false) { PlaceAssetMsg.sendPlaceAssetError(origin, 52, player.getName()); return false; } @@ -156,7 +156,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { // Retrieve the building details we're placing - if (serverZone.isNPCCity() == true) { + if (serverZone.isNPCCity == true) { PlaceAssetMsg.sendPlaceAssetError(origin, 15, ""); // Cannot place in a peace zone return false; } @@ -185,7 +185,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { // Players cannot place buildings in mob zones. if ((serverZone.isMacroZone() == true) - || (serverZone.getParent().isMacroZone() == true)) { + || (serverZone.parent.isMacroZone() == true)) { PlaceAssetMsg.sendPlaceAssetError(origin, 57, player.getName()); // No building may be placed within this territory return false; } @@ -201,8 +201,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { // Cannot place assets on a dead tree - if ((serverZone.isPlayerCity()) - && (City.getCity(serverZone.getPlayerCityUUID()).getTOL().getRank() == -1)) { + if ((serverZone.isPlayerCity) + && (City.getCity(serverZone.playerCityID).getTOL().getRank() == -1)) { PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot place asset on dead tree until world heals"); return false; } @@ -261,14 +261,14 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { // Must be a player city - if (serverZone.isPlayerCity() == false) { + if (serverZone.isPlayerCity == false) { PlaceAssetMsg.sendPlaceAssetError(origin, 41, player.getName()); // Cannot place outside a guild zone return false; } //Test zone has a city object - City city = City.getCity(serverZone.getPlayerCityUUID()); + City city = City.getCity(serverZone.playerCityID); if (city == null) { PlaceAssetMsg.sendPlaceAssetError(origin, 52, ""); //"no city to associate asset with" @@ -512,7 +512,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { if (serverZone == null) return false; - cityObject = City.getCity(serverZone.getPlayerCityUUID()); + cityObject = City.getCity(serverZone.playerCityID); // Early exit if something went horribly wrong @@ -571,7 +571,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { // No valid player city found - if (serverCity == null || serverCity.getParent().isPlayerCity() == false) { + if (serverCity == null || serverCity.getParent().isPlayerCity == false) { PlaceAssetMsg.sendPlaceAssetError(origin, 52, ""); // Cannot place outisde a guild zone return false; } @@ -749,8 +749,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { cityObjects = DbManager.CityQueries.CREATE_CITY(playerCharacter.getObjectUUID(), serverZone.getObjectUUID(), serverRealm.getRealmID(), - plantLoc.x - serverZone.getAbsX(), plantLoc.y, - plantLoc.z - serverZone.getAbsZ(), treeInfo.getRot().y, treeInfo.getW(), playerCharacter.getGuild().getName(), LocalDateTime.now()); + plantLoc.x - serverZone.absX, plantLoc.y, + plantLoc.z - serverZone.absZ, treeInfo.getRot().y, treeInfo.getW(), playerCharacter.getGuild().getName(), LocalDateTime.now()); // Uh oh! @@ -783,10 +783,10 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { // Link the zone with the city and then add // to the appropriate hash tables and cache - zoneObject.setPlayerCity(true); + zoneObject.isPlayerCity = true; - if (zoneObject.getParent() != null) - zoneObject.getParent().addNode(zoneObject); //add as child to parent + if (zoneObject.parent != null) + zoneObject.parent.addNode(zoneObject); //add as child to parent ZoneManager.addZone(zoneObject.getObjectUUID(), zoneObject); ZoneManager.addPlayerCityZone(zoneObject); @@ -857,7 +857,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { if (serverZone == null) return false; - cityObject = City.getCity(serverZone.getPlayerCityUUID()); + cityObject = City.getCity(serverZone.playerCityID); if (cityObject == null) return false; @@ -931,7 +931,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { int shrineCount = 0; - cityObject = City.getCity(serverZone.getPlayerCityUUID()); + cityObject = City.getCity(serverZone.playerCityID); // Cannot place shrine in abandoned city. Shrines must be owned // by the tol owner not the person placing them. @@ -1001,7 +1001,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { int barracksCount = 0; - cityObject = City.getCity(serverZone.getPlayerCityUUID()); + cityObject = City.getCity(serverZone.playerCityID); // Cannot place barracks in abandoned city. @@ -1061,7 +1061,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { if (validateCityBuildingPlacement(serverZone, msg, origin, player, msg.getFirstPlacementInfo()) == false) return false; - cityObject = City.getCity(serverZone.getPlayerCityUUID()); + cityObject = City.getCity(serverZone.playerCityID); // We need to be able to access how much gold a character is carrying @@ -1117,7 +1117,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { building.removeFromCache(); WorldGrid.RemoveWorldObject(building); WorldGrid.removeObject(building); - building.getParentZone().getParent().zoneBuildingSet.remove(building); + building.getParentZone().parent.zoneBuildingSet.remove(building); if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.BARRACK)) { building.RemoveFromBarracksList(); } @@ -1229,7 +1229,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { shrineType = Shrine.getShrineTypeByBlueprintUUID(blueprint.getBlueprintUUID()); - city = City.getCity(currentZone.getPlayerCityUUID()); + city = City.getCity(currentZone.playerCityID); if (city == null) return false; @@ -1294,7 +1294,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { return false; } - city = City.getCity(currentZone.getPlayerCityUUID()); + city = City.getCity(currentZone.playerCityID); if (city == null) return false; @@ -1369,7 +1369,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { newMesh.runAfterLoad(); } else if (ago.getObjectType() == GameObjectType.Warehouse) { Warehouse warehouse = (Warehouse) ago; - City city = City.getCity(currentZone.getPlayerCityUUID()); + City city = City.getCity(currentZone.playerCityID); if (city == null) return true; diff --git a/src/engine/net/client/handlers/RepairBuildingMsgHandler.java b/src/engine/net/client/handlers/RepairBuildingMsgHandler.java index 393c54be..9582b269 100644 --- a/src/engine/net/client/handlers/RepairBuildingMsgHandler.java +++ b/src/engine/net/client/handlers/RepairBuildingMsgHandler.java @@ -44,11 +44,11 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler { serverZone = ZoneManager.findSmallestZone(pc.getLoc()); - if (serverZone.getPlayerCityUUID() == 0 && targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.MINE) + if (serverZone.playerCityID == 0 && targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.MINE) return; - City city = City.GetCityFromCache(serverZone.getPlayerCityUUID()); + City city = City.GetCityFromCache(serverZone.playerCityID); if (city != null) { if (city.getBane() != null && city.protectionEnforced == false) diff --git a/src/engine/net/client/msg/CityAssetMsg.java b/src/engine/net/client/msg/CityAssetMsg.java index e83a1830..0d8490d7 100644 --- a/src/engine/net/client/msg/CityAssetMsg.java +++ b/src/engine/net/client/msg/CityAssetMsg.java @@ -92,7 +92,7 @@ public class CityAssetMsg extends ClientNetMsg { return; } - city = City.getCity(zone.getPlayerCityUUID()); + city = City.getCity(zone.playerCityID); if (city == null) { Logger.debug("Failed to load city data for Tree of life."); diff --git a/src/engine/net/client/msg/GuildTreeStatusMsg.java b/src/engine/net/client/msg/GuildTreeStatusMsg.java index f9c662d7..40538544 100644 --- a/src/engine/net/client/msg/GuildTreeStatusMsg.java +++ b/src/engine/net/client/msg/GuildTreeStatusMsg.java @@ -117,8 +117,8 @@ public class GuildTreeStatusMsg extends ClientNetMsg { city = null; if (cityZone != null) - if (cityZone.isPlayerCity()) - city = City.GetCityFromCache(cityZone.getPlayerCityUUID()); + if (cityZone.isPlayerCity) + city = City.GetCityFromCache(cityZone.playerCityID); else if (this.treeOfLife != null && this.treeOfLife.getGuild() != null) city = this.treeOfLife.getGuild().getOwnedCity(); diff --git a/src/engine/net/client/msg/ManageCityAssetsMsg.java b/src/engine/net/client/msg/ManageCityAssetsMsg.java index 473082b2..94cc837b 100644 --- a/src/engine/net/client/msg/ManageCityAssetsMsg.java +++ b/src/engine/net/client/msg/ManageCityAssetsMsg.java @@ -299,8 +299,8 @@ public class ManageCityAssetsMsg extends ClientNetMsg { Set buildings = ZoneManager.findSmallestZone(assetManager.getLoc()).zoneBuildingSet; Building tol = null; - if (playerZone.getPlayerCityUUID() != 0) - city = City.GetCityFromCache(playerZone.getPlayerCityUUID()); + if (playerZone.playerCityID != 0) + city = City.GetCityFromCache(playerZone.playerCityID); if (city != null) tol = city.getTOL(); @@ -368,7 +368,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg { if (zone == null) return; - City banedCity = City.getCity(zone.getPlayerCityUUID()); + City banedCity = City.getCity(zone.playerCityID); if (banedCity == null) return; @@ -479,7 +479,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg { if (zone == null) writer.putString("Forlord"); else - writer.putString(zone.getName()); + writer.putString(zone.zoneName); writer.putString(building.getGuild().getName()); @@ -621,9 +621,9 @@ public class ManageCityAssetsMsg extends ClientNetMsg { } else { writer.putInt(1); //kos on/off? writer.putInt(3); // was 3 - if (zone.getPlayerCityUUID() != 0 && asset.assetIsProtected()) { + if (zone.playerCityID != 0 && asset.assetIsProtected()) { writer.putInt(GameObjectType.Building.ordinal()); - writer.putInt(City.getCity(zone.getPlayerCityUUID()).getTOL().getObjectUUID()); + writer.putInt(City.getCity(zone.playerCityID).getTOL().getObjectUUID()); } else { writer.putInt(0); writer.putInt(0); diff --git a/src/engine/net/client/msg/ViewResourcesMessage.java b/src/engine/net/client/msg/ViewResourcesMessage.java index 9457e159..55a4eab0 100644 --- a/src/engine/net/client/msg/ViewResourcesMessage.java +++ b/src/engine/net/client/msg/ViewResourcesMessage.java @@ -73,7 +73,7 @@ public class ViewResourcesMessage extends ClientNetMsg { if (this.warehouseBuilding.getParentZone() == null) return false; - this.city = (City) DbManager.getObject(Enum.GameObjectType.City, this.warehouseBuilding.getParentZone().getPlayerCityUUID()); + this.city = (City) DbManager.getObject(Enum.GameObjectType.City, this.warehouseBuilding.getParentZone().playerCityID); if (this.city == null) return false; diff --git a/src/engine/objects/AbstractIntelligenceAgent.java b/src/engine/objects/AbstractIntelligenceAgent.java index 193ee31d..2c9313a3 100644 --- a/src/engine/objects/AbstractIntelligenceAgent.java +++ b/src/engine/objects/AbstractIntelligenceAgent.java @@ -130,7 +130,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter { ArrayList allIn = ZoneManager.getAllZonesIn(this.getLoc()); for (Zone zone : allIn) - if (zone.getSafeZone() == (byte) 1) + if (zone.peaceZone == (byte) 1) return true; return false; diff --git a/src/engine/objects/Bane.java b/src/engine/objects/Bane.java index 8ba5a1f9..38f50ff9 100644 --- a/src/engine/objects/Bane.java +++ b/src/engine/objects/Bane.java @@ -162,8 +162,8 @@ public final class Bane { // Cannot place assets on a dead tree - if ((cityZone.isPlayerCity()) && - (City.getCity(cityZone.getPlayerCityUUID()).getTOL().getRank() == -1)) { + if ((cityZone.isPlayerCity) && + (City.getCity(cityZone.playerCityID).getTOL().getRank() == -1)) { PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot bane a dead tree!"); return false; } diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index 7f63ab41..33cf5b06 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -460,10 +460,10 @@ public class Building extends AbstractWorldObject { } } } - if (this.parentZone.isPlayerCity() == false) + if (this.parentZone.isPlayerCity == false) return null; - return City.getCity(this.parentZone.getPlayerCityUUID()); + return City.getCity(this.parentZone.playerCityID); } @@ -1402,7 +1402,7 @@ public class Building extends AbstractWorldObject { // Buildings on an npc citygrid are never vulnerable if (this.getCity() != null) { - if (this.getCity().getParent().isNPCCity() == true) + if (this.getCity().getParent().isNPCCity == true) return false; } diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index 39b70bd9..834b155e 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -334,7 +334,7 @@ public class City extends AbstractWorldObject { if (city.noTeleport) continue; - if (city.parentZone != null && city.parentZone.isPlayerCity()) { + if (city.parentZone != null && city.parentZone.isPlayerCity) { if (pc.getAccount().status.equals(AccountStatus.ADMIN)) { cities.add(city); @@ -395,7 +395,7 @@ public class City extends AbstractWorldObject { if (city.noRepledge) continue; - if (city.parentZone != null && city.parentZone.isPlayerCity()) { + if (city.parentZone != null && city.parentZone.isPlayerCity) { //list Player cities //open city, just list @@ -589,7 +589,7 @@ public class City extends AbstractWorldObject { if (zone.getHeightMap() == null && this.isNpc == 1 && this.getObjectUUID() != 1213) { HeightMap.GenerateCustomHeightMap(zone); - Logger.info(zone.getName() + " created custom heightmap"); + Logger.info(zone.zoneName + " created custom heightmap"); } } catch (Exception e) { Logger.error(e); @@ -791,7 +791,7 @@ public class City extends AbstractWorldObject { // Any players currently in the zone will not be processed by the heartbeat // if it's not the first effect toggled so we do it here manually - currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, this.parentZone.getBounds().getHalfExtents().x * 1.2f, MBServerStatics.MASK_PLAYER); + currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, this.parentZone.bounds.getHalfExtents().x * 1.2f, MBServerStatics.MASK_PLAYER); for (AbstractWorldObject playerObject : currentPlayers) { @@ -874,7 +874,7 @@ public class City extends AbstractWorldObject { } public boolean isLocationOnCityZone(Vector3fImmutable insideLoc) { - return Bounds.collide(insideLoc, this.parentZone.getBounds()); + return Bounds.collide(insideLoc, this.parentZone.bounds); } private void applyAllCityEffects(PlayerCharacter player) { diff --git a/src/engine/objects/ItemFactory.java b/src/engine/objects/ItemFactory.java index 34b06cb0..20229512 100644 --- a/src/engine/objects/ItemFactory.java +++ b/src/engine/objects/ItemFactory.java @@ -104,7 +104,7 @@ public class ItemFactory { if (zone == null) return null; - City city = City.getCity(zone.getPlayerCityUUID()); + City city = City.getCity(zone.playerCityID); if (city == null) return null; @@ -796,7 +796,7 @@ public class ItemFactory { if (zone == null) return null; - City city = City.getCity(zone.getPlayerCityUUID()); + City city = City.getCity(zone.playerCityID); if (city == null) return null; diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 7a2a4b56..5a46af13 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -64,7 +64,7 @@ public class Mine extends AbstractGameObject { this.flags = rs.getInt("flags"); int parent = rs.getInt("parent"); this.parentZone = ZoneManager.getZoneByUUID(parent); - this.zoneName = this.parentZone.getParent().getName(); + this.zoneName = this.parentZone.parent.zoneName; this.owningGuild = Guild.getGuild(ownerUID); Guild nation = null; @@ -129,7 +129,7 @@ public class Mine extends AbstractGameObject { mine.getTimestamps().put("MineAttack", System.currentTimeMillis() + MBServerStatics.ONE_MINUTE); - ChatManager.chatNationInfo(mine.getGuild().getNation(), mine.getName() + " in " + mine.getParentZone().getParent().getName() + " is Under attack!"); + ChatManager.chatNationInfo(mine.getGuild().getNation(), mine.getName() + " in " + mine.getParentZone().parent.zoneName + " is Under attack!"); } public static void loadAllMines() { diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index dfa8e827..662c8a46 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -894,7 +894,7 @@ public class NPC extends AbstractCharacter { this.stamina.set(this.staminaMax); } - if (this.parentZone.isPlayerCity()) + if (this.parentZone.isPlayerCity) if (NPC.GetNPCProfits(this) == null) NPCProfits.CreateProfits(this); @@ -1192,7 +1192,7 @@ public class NPC extends AbstractCharacter { if (serverZone == null) return null; - city = City.GetCityFromCache(serverZone.getPlayerCityUUID()); + city = City.GetCityFromCache(serverZone.playerCityID); if (city == null) { diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 69cee884..170d0cec 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -1507,16 +1507,16 @@ public class PlayerCharacter extends AbstractCharacter { return true; Zone zone = ZoneManager.findSmallestZone(breather.getLoc()); - if (zone.getSeaLevel() != 0) { + if (zone.seaLevel != 0) { float localAltitude = breather.getLoc().y; - if (localAltitude + breather.characterHeight < zone.getSeaLevel() - 2) + if (localAltitude + breather.characterHeight < zone.seaLevel - 2) return false; if (breather.isMoving()) { - if (localAltitude + breather.characterHeight < zone.getSeaLevel()) + if (localAltitude + breather.characterHeight < zone.seaLevel) return false; } } else { @@ -1547,12 +1547,12 @@ public class PlayerCharacter extends AbstractCharacter { Zone zone = ZoneManager.findSmallestZone(enterer.getLoc()); - if (zone.getSeaLevel() != 0) { + if (zone.seaLevel != 0) { float localAltitude = enterer.getLoc().y + enterer.characterHeight; - if (localAltitude < zone.getSeaLevel()) + if (localAltitude < zone.seaLevel) return true; } else { if (enterer.getLoc().y + enterer.characterHeight < 0) @@ -1579,12 +1579,12 @@ public class PlayerCharacter extends AbstractCharacter { leaveWater = 1f; - if (zone.getSeaLevel() != 0) { + if (zone.seaLevel != 0) { float localAltitude = leaver.getLoc().y; - if (localAltitude + leaveWater < zone.getSeaLevel()) + if (localAltitude + leaveWater < zone.seaLevel) return false; } else { if (leaver.getLoc().y + leaveWater < 0) @@ -1703,7 +1703,7 @@ public class PlayerCharacter extends AbstractCharacter { Zone zone = ZoneManager.findSmallestZone(this.getLoc()); if (zone != null) { - return zone.getSafeZone() == (byte) 1; + return zone.peaceZone == (byte) 1; } return false; @@ -1797,7 +1797,7 @@ public class PlayerCharacter extends AbstractCharacter { //DeathShroud - if (zone.getSafeZone() == 0) + if (zone.peaceZone == 0) PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); //enable this to give players deathshroud if mobs kill player. @@ -1843,7 +1843,7 @@ public class PlayerCharacter extends AbstractCharacter { //DeathShroud - if (zone.getSafeZone() == 0) + if (zone.peaceZone == 0) PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); if (doPVPEXP) { @@ -1898,7 +1898,7 @@ public class PlayerCharacter extends AbstractCharacter { killCleanup(); Zone zone = ZoneManager.findSmallestZone(this.getLoc()); - if (zone.getSafeZone() == 0) + if (zone.peaceZone == 0) PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); // Send death message if needed @@ -4739,10 +4739,10 @@ public class PlayerCharacter extends AbstractCharacter { Zone zone = ZoneManager.findSmallestZone(this.getLoc()); - if (zone.getSeaLevel() != 0) { + if (zone.seaLevel != 0) { float localAltitude = this.getLoc().y + this.centerHeight; - if (localAltitude < zone.getSeaLevel()) + if (localAltitude < zone.seaLevel) return true; } else { if (this.getLoc().y + this.centerHeight < 0) @@ -4764,9 +4764,9 @@ public class PlayerCharacter extends AbstractCharacter { Zone zone = ZoneManager.findSmallestZone(currentLoc); - if (zone.getSeaLevel() != 0) { + if (zone.seaLevel != 0) { - if (localAltitude < zone.getSeaLevel()) + if (localAltitude < zone.seaLevel) return true; } else { if (localAltitude < 0) diff --git a/src/engine/objects/Runegate.java b/src/engine/objects/Runegate.java index 762265a5..673df36c 100644 --- a/src/engine/objects/Runegate.java +++ b/src/engine/objects/Runegate.java @@ -108,7 +108,7 @@ public class Runegate { writer.putInt(gateBuilding.getObjectType().ordinal()); writer.putInt(gateBuilding.getObjectUUID()); - writer.putString(gateBuilding.getParentZone().getName()); + writer.putString(gateBuilding.getParentZone().zoneName); writer.putFloat(gateBuilding.getLoc().getLat()); writer.putFloat(gateBuilding.getLoc().getAlt()); writer.putFloat(gateBuilding.getLoc().getLong()); diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index f96a5fcb..effb2a83 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -1272,7 +1272,7 @@ public class Warehouse extends AbstractWorldObject { return; } - City city = City.getCity(cityZone.getPlayerCityUUID()); + City city = City.getCity(cityZone.playerCityID); if (city == null) { Logger.error("Failed to load City for Warehouse with UUID " + this.getObjectUUID()); diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index 42595a35..400c7def 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -33,31 +33,31 @@ public class Zone extends AbstractGameObject { public final Set zoneBuildingSet = Collections.newSetFromMap(new ConcurrentHashMap<>()); public final Set zoneNPCSet = Collections.newSetFromMap(new ConcurrentHashMap<>()); public final Set zoneMobSet = Collections.newSetFromMap(new ConcurrentHashMap<>()); - private final int playerCityID; - private final String zoneName; - private final float xCoord; - private final float zCoord; - private final float yCoord; - private final int loadNum; - private final byte safeZone; - private final String Icon1; - private final String Icon2; - private final String Icon3; + public final int playerCityID; + public final String zoneName; + public final float xCoord; + public final float zCoord; + public final float yCoord; + public final int loadNum; + public final byte peaceZone; + public final String Icon1; + public final String Icon2; + public final String Icon3; public float absX = 0.0f; public float absY = 0.0f; public float absZ = 0.0f; public int minLvl; public int maxLvl; public boolean hasBeenHotzone = false; - private ArrayList nodes = null; - private int parentZoneID; - private Zone parent = null; - private Bounds bounds; - private boolean isNPCCity = false; - private boolean isPlayerCity = false; - private String hash; + public ArrayList nodes = null; + public int parentZoneID; + public Zone parent = null; + public Bounds bounds; + public boolean isNPCCity = false; + public boolean isPlayerCity = false; + public String hash; public float worldAltitude = 0; - private float seaLevel = 0f; + public float seaLevel = 0f; public static final Set respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>()); public static long lastRespawn = 0; public Bounds maxBlend; @@ -75,7 +75,7 @@ public class Zone extends AbstractGameObject { this.zCoord = rs.getFloat("ZCoord"); this.yCoord = rs.getFloat("YOffset"); this.loadNum = rs.getInt("LoadNum"); - this.safeZone = rs.getByte("SafeZone"); + this.peaceZone = rs.getByte("SafeZone"); this.Icon1 = rs.getString("Icon1"); this.Icon2 = rs.getString("Icon2"); this.Icon3 = rs.getString("Icon3"); @@ -147,7 +147,7 @@ public class Zone extends AbstractGameObject { writer.putString(city.getCityName()); else writer.putString(zone.zoneName); - writer.put(zone.safeZone); + writer.put(zone.peaceZone); writer.putString(zone.Icon1); writer.putString(zone.Icon2); writer.putString(zone.Icon3); @@ -182,50 +182,14 @@ public class Zone extends AbstractGameObject { // Set heightmap blending bounds if (heightMap == null) { - this.maxBlend = this.getBounds(); + this.maxBlend = bounds; } else { this.maxBlend = Bounds.borrow(); - this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), this.getBounds().getHalfExtents().subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f); + this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), bounds.getHalfExtents().subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f); } } - public int getPlayerCityUUID() { - return this.playerCityID; - } - - public String getName() { - return zoneName; - } - - public float getXCoord() { - return xCoord; - } - - public float getYCoord() { - return yCoord; - } - - public float getZCoord() { - return zCoord; - } - - public int getLoadNum() { - return loadNum; - } - - public byte getSafeZone() { - return safeZone; - } - - public String getIcon1() { - return Icon1; - } - - public Zone getParent() { - return this.parent; - } - public void setParent(final Zone value) { this.parent = value; @@ -254,7 +218,7 @@ public class Zone extends AbstractGameObject { this.setBounds(); this.worldAltitude = ZoneManager.caclulateWorldAltitude(this); - if (this.getParent() == null) { + if (this.parent == null) { this.seaLevel = MBServerStatics.SEA_FLOOR_ALTITUDE; return; } @@ -271,18 +235,6 @@ public class Zone extends AbstractGameObject { } - public float getAbsX() { - return this.absX; - } - - public float getAbsY() { - return this.absY; - } - - public float getAbsZ() { - return this.absZ; - } - public boolean isMacroZone() { // Macro zones have icons. @@ -293,23 +245,7 @@ public class Zone extends AbstractGameObject { if (this.parent == null) return false; - return !this.getIcon1().equals(""); - } - - public boolean isNPCCity() { - return this.isNPCCity; - } - - public void setNPCCity(boolean value) { - this.isNPCCity = value; - } - - public boolean isPlayerCity() { - return this.isPlayerCity; - } - - public void setPlayerCity(boolean value) { - this.isPlayerCity = value; + return !Icon1.equals(""); } public Vector3fImmutable getLoc() { @@ -358,19 +294,8 @@ public class Zone extends AbstractGameObject { if (this.getNodes().get(0).isMacroZone()) return true; - return this.getParent().equals(ZoneManager.getSeaFloor()); - - } - - /** - * @return the bounds - */ - public Bounds getBounds() { - return bounds; - } + return this.parent.equals(ZoneManager.getSeaFloor()); - public String getHash() { - return hash; } public void setHash() { @@ -392,8 +317,4 @@ public class Zone extends AbstractGameObject { return HeightMap.heightmapByLoadNum.get(this.loadNum); } - public float getSeaLevel() { - return seaLevel; - } - } diff --git a/src/engine/powers/poweractions/SummonPowerAction.java b/src/engine/powers/poweractions/SummonPowerAction.java index 92d3c92e..03fe028e 100644 --- a/src/engine/powers/poweractions/SummonPowerAction.java +++ b/src/engine/powers/poweractions/SummonPowerAction.java @@ -55,7 +55,7 @@ public class SummonPowerAction extends AbstractPowerAction { String location = "Somewhere"; if (zone != null) - location = zone.getName(); + location = zone.zoneName; RecvSummonsRequestMsg rsrm = new RecvSummonsRequestMsg(source.getObjectType().ordinal(), source.getObjectUUID(), source.getFirstName(), location, false); diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 0956ca11..da1437f1 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -469,7 +469,7 @@ public class WorldServer { for (Zone zone : ZoneManager.getAllZones()) { if (zone.getHeightMap() != null) { if (zone.getHeightMap().bucketWidthX == 0) { - System.out.println("Zone load num: " + zone.getLoadNum() + " has no bucket width"); + System.out.println("Zone load num: " + zone.loadNum + " has no bucket width"); } } } @@ -565,7 +565,7 @@ public class WorldServer { for (Zone zone : rootParent) { - ZoneManager.addZone(zone.getLoadNum(), zone); + ZoneManager.addZone(zone.loadNum, zone); //Handle Buildings diff --git a/src/engine/workthreads/DestroyCityThread.java b/src/engine/workthreads/DestroyCityThread.java index aeb46a6c..22cb72e1 100644 --- a/src/engine/workthreads/DestroyCityThread.java +++ b/src/engine/workthreads/DestroyCityThread.java @@ -53,7 +53,7 @@ public class DestroyCityThread implements Runnable { // Member variable assignment cityZone = city.getParent(); - newParent = cityZone.getParent(); + newParent = cityZone.parent; formerGuild = city.getTOL().getGuild(); // Former guild loses it's tree! @@ -150,6 +150,6 @@ public class DestroyCityThread implements Runnable { // Zone and city should vanish upon next reboot // if the codebase reaches here. - Logger.info(city.getParent().getName() + " uuid:" + city.getObjectUUID() + "has been destroyed!"); + Logger.info(city.getParent().zoneName + " uuid:" + city.getObjectUUID() + "has been destroyed!"); } } diff --git a/src/engine/workthreads/HourlyJobThread.java b/src/engine/workthreads/HourlyJobThread.java index dbf17e0c..556175c9 100644 --- a/src/engine/workthreads/HourlyJobThread.java +++ b/src/engine/workthreads/HourlyJobThread.java @@ -166,7 +166,7 @@ public class HourlyJobThread implements Runnable { mineBuilding.rebuildMine(); WorldGrid.updateObject(mineBuilding); - ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().getParent().getName() + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active."); + ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().parent.zoneName + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active."); chatMsg.setMessageType(10); chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); DispatchMessage.dispatchMsgToAll(chatMsg); @@ -205,7 +205,7 @@ public class HourlyJobThread implements Runnable { if (ZoneManager.hotZone == null) { Logger.error("Null HotZone returned from ZoneManager"); } else { - Logger.info("HotZone switched to: " + ZoneManager.hotZone.getName()); + Logger.info("HotZone switched to: " + ZoneManager.hotZone.zoneName); } } catch (Exception e) {