Inlined empty getters

This commit is contained in:
2023-09-20 15:43:01 -04:00
parent bf9fdae58b
commit 46b3db033b
58 changed files with 210 additions and 284 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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
+24 -24
View File
@@ -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;
}
}