From 1e9eec2c484b4423a2b64b6258f01efc7d24f19f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 20 Sep 2023 16:24:00 -0400 Subject: [PATCH] Heightmap is now an integer. --- src/engine/InterestManagement/HeightMap.java | 5 +++-- src/engine/objects/Zone.java | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index a5c0a658..b863a143 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -40,7 +40,7 @@ public class HeightMap { public static final HashMap heightmapByLoadNum = new HashMap<>(); - public static final HashMap _pixelData = new HashMap<>(); + public static final HashMap _pixelData = new HashMap<>(); // Heightmap data for all zones. public static float SCALEVALUE = 1.0f / 255; @@ -341,7 +341,8 @@ public class HeightMap { // Insert color data into lookup table - _pixelData.put(imageFile.getName().substring(0, imageFile.getName().lastIndexOf(".")), colorData); + int heightMapID = Integer.parseInt(imageFile.getName().substring(0, imageFile.getName().lastIndexOf("."))); + _pixelData.put(heightMapID, colorData); } catch (IOException e) { Logger.error(e); diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index 34c6d793..c4af8ee1 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -61,6 +61,15 @@ public class Zone extends AbstractGameObject { public static final Set respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>()); public static long lastRespawn = 0; public Bounds blendBounds; + public float major_radius; + public float minor_radius; + public float min_blend; + public float max_blend; + public String sea_level_type; + public float sea_level; + public String terrain_type; + public float terrain_max_y; + public int terrain_image; /** * ResultSet Constructor @@ -81,7 +90,15 @@ public class Zone extends AbstractGameObject { this.icon3 = rs.getString("icon3"); this.min_level = rs.getInt("min_level"); this.max_level = rs.getInt("max_level"); - this.hash = rs.getString("hash"); + this.major_radius = rs.getFloat("major_radius"); + this.minor_radius = rs.getFloat("minor_radius"); + this.min_blend = rs.getFloat("min_blend"); + this.max_blend = rs.getFloat("max_blend"); + this.sea_level_type = rs.getString("sea_level_type"); + this.sea_level = rs.getFloat("sea_level"); + this.terrain_type = rs.getString("terrain_type"); + this.terrain_max_y = rs.getFloat("terrain_max_y"); + this.terrain_image = rs.getInt("terrain_image"); //this needs to be here specifically for new zones created after server boot (e.g. player city zones)