From 3986dc06865943cbb26d8e5d066790db1c5750ce Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 20 Oct 2023 17:22:57 -0400 Subject: [PATCH] Peace zone needs to come from zone tree --- src/engine/InterestManagement/Terrain.java | 12 ++++++------ src/engine/objects/Zone.java | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 2cf5eda6..4db671ab 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -49,8 +49,8 @@ public class Terrain { // Configure terrain based on zone properties - this.terrain_size.x = this.zone.template.major_radius * 2; - this.terrain_size.y = this.zone.template.minor_radius * 2; + this.terrain_size.x = this.zone.major_radius * 2; + this.terrain_size.y = this.zone.minor_radius * 2; this.cell_count.x = this.terrain_pixel_data.length - 1; this.cell_count.y = this.terrain_pixel_data[0].length - 1; @@ -62,11 +62,11 @@ public class Terrain { // the blending area between child and parent terrains when // they are stitched together. - Vector2f major_blend = new Vector2f(this.zone.template.max_blend / this.zone.template.major_radius, - this.zone.template.min_blend / this.zone.template.major_radius); + Vector2f major_blend = new Vector2f(this.zone.template.max_blend / this.zone.major_radius, + this.zone.template.min_blend / this.zone.major_radius); - Vector2f minor_blend = new Vector2f(this.zone.template.max_blend / this.zone.template.minor_radius, - this.zone.template.min_blend / this.zone.template.minor_radius); + Vector2f minor_blend = new Vector2f(this.zone.template.max_blend / this.zone.minor_radius, + this.zone.template.min_blend / this.zone.minor_radius); if (major_blend.y > 0.4f) blend_ratio.x = major_blend.y; diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index 07488b5a..32fb9c72 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -34,10 +34,13 @@ public class Zone extends AbstractWorldObject { public final Set zoneBuildingSet = Collections.newSetFromMap(new ConcurrentHashMap<>()); public final Set zoneNPCSet = Collections.newSetFromMap(new ConcurrentHashMap<>()); public final Set zoneMobSet = Collections.newSetFromMap(new ConcurrentHashMap<>()); + public ZoneTemplate template; public final int playerCityUUID; public final String zoneName; + public final float major_radius; + public final float minor_radius; public final float xOffset; public final float zOffset; public final float yOffset; @@ -72,17 +75,23 @@ public class Zone extends AbstractWorldObject { super(rs); this.parentZoneID = rs.getInt("parent"); - this.playerCityUUID = rs.getInt("playerCityUUID"); - this.guild_zone = this.playerCityUUID != 0; + this.templateID = rs.getInt("template"); this.zoneName = rs.getString("zone_name"); + this.peace_zone = rs.getByte("peace_zone"); + + this.major_radius = rs.getFloat("major_radius"); + this.minor_radius = rs.getFloat("minor_radius"); this.xOffset = rs.getFloat("xOffset"); this.zOffset = rs.getFloat("zOffset"); this.yOffset = rs.getFloat("yOffset"); - this.templateID = rs.getInt("template"); - this.peace_zone = rs.getByte("peace_zone"); + + this.playerCityUUID = rs.getInt("playerCityUUID"); + this.guild_zone = this.playerCityUUID != 0; + this.icon1 = rs.getString("icon1"); this.icon2 = rs.getString("icon2"); this.icon3 = rs.getString("icon3"); + this.min_level = rs.getInt("min_level"); this.max_level = rs.getInt("max_level");