forked from MagicBane/Server
property conforms to JSON
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<Mob> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user