forked from MagicBane/Server
Inlined empty getters
This commit is contained in:
@@ -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<Item> 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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.");
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -299,8 +299,8 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
||||
Set<Building> 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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user