Browse Source

Visibility promotion for a data class

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
3fb08ca2c3
  1. 38
      src/engine/InterestManagement/HeightMap.java
  2. 4
      src/engine/db/handlers/dbHeightMapHandler.java
  3. 6
      src/engine/devcmd/cmds/ZoneInfoCmd.java
  4. 4
      src/engine/objects/Zone.java
  5. 2
      src/engine/server/world/WorldServer.java

38
src/engine/InterestManagement/HeightMap.java

@ -48,16 +48,16 @@ public class HeightMap {
public BufferedImage heightmapImage; public BufferedImage heightmapImage;
private final int heightMapID; public final int heightMapID;
private final int maxHeight; public final int maxHeight;
private final int fullExtentsX; public final int fullExtentsX;
private final int fullExtentsY; public final int fullExtentsY;
private float bucketWidthX; public float bucketWidthX;
private float bucketWidthY; public float bucketWidthY;
private final int zoneLoadID; public final int zoneLoadID;
private float seaLevel = 0; public float seaLevel = 0;
private int[][] pixelColorValues; public int[][] pixelColorValues;
public float zone_minBlend; public float zone_minBlend;
public float zone_maxBlend; public float zone_maxBlend;
@ -391,24 +391,4 @@ public class HeightMap {
return interpolatedHeight; 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;
}
} }

4
src/engine/db/handlers/dbHeightMapHandler.java

@ -29,8 +29,8 @@ public class dbHeightMapHandler extends dbHandlerBase {
while (rs.next()) { while (rs.next()) {
thisHeightmap = new HeightMap(rs); thisHeightmap = new HeightMap(rs);
if (thisHeightmap.getHeightmapImage() == null) { if (thisHeightmap.heightmapImage == null) {
Logger.info("Imagemap for " + thisHeightmap.getHeightMapID() + " was null"); Logger.info("Imagemap for " + thisHeightmap.heightMapID + " was null");
continue; continue;
} }
} }

6
src/engine/devcmd/cmds/ZoneInfoCmd.java

@ -91,11 +91,11 @@ public class ZoneInfoCmd extends AbstractDevCmd {
output += newline; output += newline;
if (zone.getHeightMap() != null) { if (zone.getHeightMap() != null) {
output += "HeightMap ID: " + zone.getHeightMap().getHeightMapID(); output += "HeightMap ID: " + zone.getHeightMap().heightMapID;
output += newline; output += newline;
output += "Bucket Width X : " + zone.getHeightMap().getBucketWidthX(); output += "Bucket Width X : " + zone.getHeightMap().bucketWidthX;
output += newline; 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; output += "radius: x: " + zone.getBounds().getHalfExtents().x + ", z: " + zone.getBounds().getHalfExtents().y;

4
src/engine/objects/Zone.java

@ -280,8 +280,8 @@ public class Zone extends AbstractGameObject {
return; return;
} }
if (this.getHeightMap().getSeaLevel() != 0) if (this.getHeightMap().seaLevel != 0)
this.seaLevel = this.worldAltitude + this.getHeightMap().getSeaLevel(); this.seaLevel = this.worldAltitude + this.getHeightMap().seaLevel;
else else
this.seaLevel = this.parent.seaLevel; this.seaLevel = this.parent.seaLevel;

2
src/engine/server/world/WorldServer.java

@ -468,7 +468,7 @@ public class WorldServer {
for (Zone zone : ZoneManager.getAllZones()) { for (Zone zone : ZoneManager.getAllZones()) {
if (zone.getHeightMap() != null) { 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"); System.out.println("Zone load num: " + zone.getLoadNum() + " has no bucket width");
} }
} }

Loading…
Cancel
Save