From d31d6c1f958f609c85991af5ec111133971d4721 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 8 Oct 2023 22:36:26 -0400 Subject: [PATCH] Configure player cities and PLANAR --- src/engine/InterestManagement/Terrain.java | 11 ++++++++++- src/engine/objects/Zone.java | 13 +++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 6e114dc6..c44be525 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -26,13 +26,22 @@ public class Terrain { public Vector2f cell_size = new Vector2f(); public Vector2f cell_count = new Vector2f(); public float terrain_scale; + public int template; + public int heightmap; public Terrain(Zone zone) { + this.heightmap = zone.terrain_image; + + // Configure PLANAR + + if (zone.terrain_type.equals("PLANAR")) + this.heightmap = 1006300; + this.terrain_size.x = zone.major_radius; this.terrain_size.y = zone.minor_radius; - this.terrain_pixel_data = _heightmap_pixel_cache.get(zone.terrain_image); + this.terrain_pixel_data = _heightmap_pixel_cache.get(heightmap); this.cell_count.x = this.terrain_pixel_data.length - 1; this.cell_count.y = this.terrain_pixel_data[0].length - 1; diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index d32e0338..52914035 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -102,6 +102,19 @@ public class Zone extends AbstractGameObject { this.terrain_max_y = rs.getFloat("terrain_max_y"); this.terrain_image = rs.getInt("terrain_image"); + if (this.guild_zone) { + this.max_blend = 128; + this.min_blend = 128; + this.major_radius = (int) Enum.CityBoundsType.ZONE.halfExtents; + this.minor_radius = (int) Enum.CityBoundsType.ZONE.halfExtents; + this.terrain_type = "PLANAR"; + } + + if (this.terrain_type.equals("None")) + this.terrain = null; + else + this.terrain = new Terrain(this); + //this needs to be here specifically for new zones created after server boot (e.g. player city zones) Zone parentZone = ZoneManager.getZoneByUUID(parentZoneID);