Build zone templates from CZONE instead of static_zone_templates
ZoneManager._zone_templates now holds the parser's CZoneTemplate: every CZONE template plus the player-city template 0, still built in code. Zone and Terrain read the mbEnums sea level and terrain types instead of strings. The static_zone_templates loader goes with the old map type; the table stays until Task 4.2. Parity: all 861 templates, every column the server read (type, name, peace, radii, blends, sea level and type, water, terrain gen, type, max_y, image) identical to the JSON. Value changes: none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ac1fcaecf5
commit
4299b27422
6 files changed
+48
-60
No files matched your search
@@ -11,6 +11,7 @@ package engine.InterestManagement;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector2f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Zone;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -46,7 +47,7 @@ public class Terrain {
|
||||
// Configure PLANAR zones to use the same 16x16 pixel image
|
||||
// that all similar terrains share. (See JSON)
|
||||
|
||||
if (this.zone.template.terrain_type.equals("PLANAR"))
|
||||
if (this.zone.template.terrain_type == mbEnums.TerrainGenType.PLANAR)
|
||||
this.heightmap = 1006300; // all 0
|
||||
|
||||
// Load pixel data for this terrain from cache
|
||||
@@ -71,8 +72,8 @@ public class Terrain {
|
||||
// the blending area between child and parent terrains when
|
||||
// they are stitched together.
|
||||
|
||||
this.blend_values.x = this.zone.template.max_blend;
|
||||
this.blend_values.y = this.zone.template.min_blend;
|
||||
this.blend_values.x = this.zone.template.zone_max_blend;
|
||||
this.blend_values.y = this.zone.template.zone_min_blend;
|
||||
|
||||
Vector2f major_blend = new Vector2f(this.blend_values.x / this.zone.major_radius,
|
||||
this.blend_values.y / this.zone.major_radius);
|
||||
@@ -217,8 +218,8 @@ public class Terrain {
|
||||
|
||||
// Normalize terrain offset
|
||||
|
||||
Vector2f normalizedOffset = new Vector2f(Math.abs(zone_offset.x) / this.zone.template.major_radius,
|
||||
Math.abs(zone_offset.y) / this.zone.template.minor_radius);
|
||||
Vector2f normalizedOffset = new Vector2f(Math.abs(zone_offset.x) / this.zone.template.zone_major_radius,
|
||||
Math.abs(zone_offset.y) / this.zone.template.zone_minor_radius);
|
||||
|
||||
float blendCoefficient;
|
||||
|
||||
|
||||
Reference in new issue
Block a user