From 8a76c8cadc33236315b337d9751bbc0d91598bfe Mon Sep 17 00:00:00 2001 From: TomTheFurry Date: Wed, 30 Mar 2022 18:56:10 +0800 Subject: [PATCH] Make DataPointUtil's WORLD HEIGHT a final again --- src/main/java/com/seibel/lod/core/api/EventApi.java | 2 +- src/main/java/com/seibel/lod/core/util/DataPointUtil.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/seibel/lod/core/api/EventApi.java b/src/main/java/com/seibel/lod/core/api/EventApi.java index b77d09e69..574e669a0 100644 --- a/src/main/java/com/seibel/lod/core/api/EventApi.java +++ b/src/main/java/com/seibel/lod/core/api/EventApi.java @@ -129,7 +129,7 @@ public class EventApi return; isCurrentlyOnSinglePlayerServer = MC.hasSinglePlayerServer(); ApiShared.isShuttingDown = false; - DataPointUtil.WORLD_HEIGHT = world.getHeight(); + //DataPointUtil.WORLD_HEIGHT = world.getHeight(); LodBuilder.MIN_WORLD_HEIGHT = world.getMinHeight(); // This updates the World height // LodNodeGenWorker.restartExecutorService(); diff --git a/src/main/java/com/seibel/lod/core/util/DataPointUtil.java b/src/main/java/com/seibel/lod/core/util/DataPointUtil.java index 8ad212421..c41691aa5 100644 --- a/src/main/java/com/seibel/lod/core/util/DataPointUtil.java +++ b/src/main/java/com/seibel/lod/core/util/DataPointUtil.java @@ -50,7 +50,7 @@ public class DataPointUtil // If there is a bug with color then it's probably caused by this. public final static int EMPTY_DATA = 0; - public static int WORLD_HEIGHT = 4096; + public final static int MAX_WORLD_Y_SIZE = 4096; public final static int ALPHA_DOWNSIZE_SHIFT = 4; @@ -389,7 +389,7 @@ public class DataPointUtil int size = dataToMerge.length / inputVerticalData; // We initialize the arrays that are going to be used - int heightAndDepthLength = (WORLD_HEIGHT / 2 + 16) * 2; + int heightAndDepthLength = (MAX_WORLD_Y_SIZE / 2 + 16) * 2; short[] heightAndDepth = tLocalHeightAndDepth.get(); if (heightAndDepth==null || heightAndDepth.length != heightAndDepthLength) { heightAndDepth = new short[heightAndDepthLength]; @@ -570,7 +570,7 @@ public class DataPointUtil while (count > maxVerticalData) { limited = true; - ii = WORLD_HEIGHT; + ii = MAX_WORLD_Y_SIZE; for (i = 0; i < count - 1; i++) { if (heightAndDepth[i * 2 + 1] - heightAndDepth[(i + 1) * 2] <= ii)