From 1b2c218e83e59ddbb6afd7780eecb18a33650ddb Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 12 Oct 2023 06:19:22 -0400 Subject: [PATCH] property conforms to JSON --- src/engine/InterestManagement/Terrain.java | 12 ++++++------ src/engine/devcmd/cmds/GetHeightCmd.java | 2 +- src/engine/devcmd/cmds/SeaAuditCmd.java | 2 +- src/engine/devcmd/cmds/ZoneInfoCmd.java | 2 +- src/engine/gameManager/ZoneManager.java | 2 +- .../net/client/handlers/PlaceAssetMsgHandler.java | 2 +- src/engine/objects/Zone.java | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index c404286d..f49eb9f3 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -35,15 +35,15 @@ public class Terrain { this.zone = zone; this.heightmap = this.zone.terrain_image; - // Configure PLANAR zones to use the same - // 16x16 pixel image that all other flat - // terrains share. + // Configure PLANAR zones to use the same 16x16 pixel image + // that all similar terrains share. (See JSON) Guild zones + // use an inverted clone of this heightmap. if (this.zone.terrain_type.equals("PLANAR")) if (this.zone.guild_zone) - this.heightmap = 1006301; + this.heightmap = 1006301; // all 255 else - this.heightmap = 1006300; + this.heightmap = 1006300; // all 0 // Load pixel data for this terrain from cache @@ -110,7 +110,7 @@ public class Terrain { // Interpolate height for this position in terrain float interpolatedChildHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc); - interpolatedChildHeight += terrainZone.worldAltitude; + interpolatedChildHeight += terrainZone.global_height; return interpolatedChildHeight; } diff --git a/src/engine/devcmd/cmds/GetHeightCmd.java b/src/engine/devcmd/cmds/GetHeightCmd.java index bb9b56f9..9b8266e7 100644 --- a/src/engine/devcmd/cmds/GetHeightCmd.java +++ b/src/engine/devcmd/cmds/GetHeightCmd.java @@ -44,7 +44,7 @@ public class GetHeightCmd extends AbstractDevCmd { this.throwbackInfo(playerCharacter, "Current Zone : " + currentZone.zoneName); this.throwbackInfo(playerCharacter, "Heightmap Zone : " + heightmapZone.zoneName); - this.throwbackInfo(playerCharacter, "Global Height: " + heightmapZone.worldAltitude); + this.throwbackInfo(playerCharacter, "Global Height: " + heightmapZone.global_height); this.throwbackInfo(playerCharacter, "Sea Level: " + heightmapZone.seaLevel); this.throwbackInfo(playerCharacter, "Grid : " + Math.floor(gridSquare.x) + "x" + Math.floor(gridSquare.y)); this.throwbackInfo(playerCharacter, "Blend: " + heightmapZone.terrain.terrainBlend(zoneOffset)); diff --git a/src/engine/devcmd/cmds/SeaAuditCmd.java b/src/engine/devcmd/cmds/SeaAuditCmd.java index f5cdbdde..ec0e6c96 100644 --- a/src/engine/devcmd/cmds/SeaAuditCmd.java +++ b/src/engine/devcmd/cmds/SeaAuditCmd.java @@ -26,7 +26,7 @@ public class SeaAuditCmd extends AbstractDevCmd { AbstractGameObject target) { for (Zone zone : ZoneManager.getAllZones()) - if (zone.seaLevel > zone.worldAltitude) + if (zone.seaLevel > zone.global_height) this.throwbackInfo(playerCharacter, zone.getObjectUUID() + zone.zoneName); } diff --git a/src/engine/devcmd/cmds/ZoneInfoCmd.java b/src/engine/devcmd/cmds/ZoneInfoCmd.java index 3786d1b4..53e7ac61 100644 --- a/src/engine/devcmd/cmds/ZoneInfoCmd.java +++ b/src/engine/devcmd/cmds/ZoneInfoCmd.java @@ -101,7 +101,7 @@ public class ZoneInfoCmd extends AbstractDevCmd { output += newline; output += "Sea Level = " + zone.seaLevel; output += newline; - output += "World Altitude = " + zone.worldAltitude; + output += "World Altitude = " + zone.global_height; throwbackInfo(player, output); City city = ZoneManager.getCityAtLocation(player.getLoc()); diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index ae544cfe..90fbb599 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -453,7 +453,7 @@ public enum ZoneManager { } } - public static float caclulateWorldAltitude(Zone zone) { + public static float calculateGlobalZoneHeight(Zone zone) { float worldAlttitude = MBServerStatics.SEA_FLOOR_ALTITUDE; diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index 6ef021a3..c62c7e8c 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -792,7 +792,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { ZoneManager.addPlayerCityZone(zoneObject); serverZone.addNode(zoneObject); - zoneObject.worldAltitude = ZoneManager.caclulateWorldAltitude(zoneObject); + zoneObject.global_height = ZoneManager.calculateGlobalZoneHeight(zoneObject); cityObject.setParent(zoneObject); cityObject.setObjectTypeMask(MBServerStatics.MASK_CITY); // *** Refactor : should have it already diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index 1878e903..8376a151 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -56,7 +56,7 @@ public class Zone extends AbstractGameObject { public boolean isNPCCity = false; public boolean guild_zone; public String hash; - public float worldAltitude = 0; + public float global_height = 0; public float seaLevel = 0f; public float sea_level_offset = 0; public static final Set respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>()); @@ -230,7 +230,7 @@ public class Zone extends AbstractGameObject { } this.setBounds(); - this.worldAltitude = ZoneManager.caclulateWorldAltitude(this); + this.global_height = ZoneManager.calculateGlobalZoneHeight(this); setSeaLevel(); } @@ -251,7 +251,7 @@ public class Zone extends AbstractGameObject { this.sea_level = this.parent.sea_level + this.sea_level_offset; break; case "SELF": - this.sea_level = this.worldAltitude + this.sea_level_offset; + this.sea_level = this.global_height + this.sea_level_offset; break; } }