From 3fb08ca2c3acd7289acbf9a6df1ee9204daa2e3b Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 17 Sep 2023 12:53:56 -0400 Subject: [PATCH] Visibility promotion for a data class --- src/engine/InterestManagement/HeightMap.java | 38 +++++-------------- .../db/handlers/dbHeightMapHandler.java | 4 +- src/engine/devcmd/cmds/ZoneInfoCmd.java | 6 +-- src/engine/objects/Zone.java | 4 +- src/engine/server/world/WorldServer.java | 2 +- 5 files changed, 17 insertions(+), 37 deletions(-) diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index 93fa7996..0ad19d18 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -48,16 +48,16 @@ public class HeightMap { public BufferedImage heightmapImage; - private final int heightMapID; - private final int maxHeight; - private final int fullExtentsX; - private final int fullExtentsY; + public final int heightMapID; + public final int maxHeight; + public final int fullExtentsX; + public final int fullExtentsY; - private float bucketWidthX; - private float bucketWidthY; - private final int zoneLoadID; - private float seaLevel = 0; - private int[][] pixelColorValues; + public float bucketWidthX; + public float bucketWidthY; + public final int zoneLoadID; + public float seaLevel = 0; + public int[][] pixelColorValues; public float zone_minBlend; public float zone_maxBlend; @@ -391,24 +391,4 @@ public class HeightMap { return interpolatedHeight; } - public float getBucketWidthX() { - return bucketWidthX; - } - - public float getBucketWidthY() { - return bucketWidthY; - } - - public int getHeightMapID() { - return heightMapID; - } - - public BufferedImage getHeightmapImage() { - return heightmapImage; - } - - public float getSeaLevel() { - return seaLevel; - } - } diff --git a/src/engine/db/handlers/dbHeightMapHandler.java b/src/engine/db/handlers/dbHeightMapHandler.java index eec0bfbc..514008de 100644 --- a/src/engine/db/handlers/dbHeightMapHandler.java +++ b/src/engine/db/handlers/dbHeightMapHandler.java @@ -29,8 +29,8 @@ public class dbHeightMapHandler extends dbHandlerBase { while (rs.next()) { thisHeightmap = new HeightMap(rs); - if (thisHeightmap.getHeightmapImage() == null) { - Logger.info("Imagemap for " + thisHeightmap.getHeightMapID() + " was null"); + if (thisHeightmap.heightmapImage == null) { + Logger.info("Imagemap for " + thisHeightmap.heightMapID + " was null"); continue; } } diff --git a/src/engine/devcmd/cmds/ZoneInfoCmd.java b/src/engine/devcmd/cmds/ZoneInfoCmd.java index 37325aef..6a1daa3d 100644 --- a/src/engine/devcmd/cmds/ZoneInfoCmd.java +++ b/src/engine/devcmd/cmds/ZoneInfoCmd.java @@ -91,11 +91,11 @@ public class ZoneInfoCmd extends AbstractDevCmd { output += newline; if (zone.getHeightMap() != null) { - output += "HeightMap ID: " + zone.getHeightMap().getHeightMapID(); + output += "HeightMap ID: " + zone.getHeightMap().heightMapID; output += newline; - output += "Bucket Width X : " + zone.getHeightMap().getBucketWidthX(); + output += "Bucket Width X : " + zone.getHeightMap().bucketWidthX; output += newline; - output += "Bucket Width Y : " + zone.getHeightMap().getBucketWidthY(); + output += "Bucket Width Y : " + zone.getHeightMap().bucketWidthY; } output += "radius: x: " + zone.getBounds().getHalfExtents().x + ", z: " + zone.getBounds().getHalfExtents().y; diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index fdfa9d49..2b644f48 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -280,8 +280,8 @@ public class Zone extends AbstractGameObject { return; } - if (this.getHeightMap().getSeaLevel() != 0) - this.seaLevel = this.worldAltitude + this.getHeightMap().getSeaLevel(); + if (this.getHeightMap().seaLevel != 0) + this.seaLevel = this.worldAltitude + this.getHeightMap().seaLevel; else this.seaLevel = this.parent.seaLevel; diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 435670cd..0956ca11 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -468,7 +468,7 @@ public class WorldServer { for (Zone zone : ZoneManager.getAllZones()) { if (zone.getHeightMap() != null) { - if (zone.getHeightMap().getBucketWidthX() == 0) { + if (zone.getHeightMap().bucketWidthX == 0) { System.out.println("Zone load num: " + zone.getLoadNum() + " has no bucket width"); } }