From 90987fc3899d031aa571992cbde3d326a3e6c942 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 3 Oct 2021 13:57:24 -0500 Subject: [PATCH] Add a constant to LodUtil and remove a few unused ones --- .../bufferBuilding/lodTemplates/Box.java | 18 +++++++++--------- .../lod/builders/lodBuilding/LodBuilder.java | 2 +- src/main/java/com/seibel/lod/util/LodUtil.java | 16 +++------------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/seibel/lod/builders/bufferBuilding/lodTemplates/Box.java b/src/main/java/com/seibel/lod/builders/bufferBuilding/lodTemplates/Box.java index dcfcf84ad..cab7fc516 100644 --- a/src/main/java/com/seibel/lod/builders/bufferBuilding/lodTemplates/Box.java +++ b/src/main/java/com/seibel/lod/builders/bufferBuilding/lodTemplates/Box.java @@ -8,6 +8,7 @@ import com.seibel.lod.config.LodConfig; import com.seibel.lod.enums.DebugMode; import com.seibel.lod.util.ColorUtil; import com.seibel.lod.util.DataPointUtil; +import com.seibel.lod.util.LodUtil; import com.seibel.lod.wrappers.MinecraftWrapper; import net.minecraft.util.Direction; @@ -166,20 +167,19 @@ public class Box colorMap = new int[6]; - // TODO what does the 32 represent? adjHeight = new HashMap() {{ - put(Direction.EAST, new int[32]); - put(Direction.WEST, new int[32]); - put(Direction.SOUTH, new int[32]); - put(Direction.NORTH, new int[32]); + put(Direction.EAST, new int[LodUtil.MAX_NUMBER_OF_VERTICAL_LODS]); + put(Direction.WEST, new int[LodUtil.MAX_NUMBER_OF_VERTICAL_LODS]); + put(Direction.SOUTH, new int[LodUtil.MAX_NUMBER_OF_VERTICAL_LODS]); + put(Direction.NORTH, new int[LodUtil.MAX_NUMBER_OF_VERTICAL_LODS]); }}; adjDepth = new HashMap() {{ - put(Direction.EAST, new int[32]); - put(Direction.WEST, new int[32]); - put(Direction.SOUTH, new int[32]); - put(Direction.NORTH, new int[32]); + put(Direction.EAST, new int[LodUtil.MAX_NUMBER_OF_VERTICAL_LODS]); + put(Direction.WEST, new int[LodUtil.MAX_NUMBER_OF_VERTICAL_LODS]); + put(Direction.SOUTH, new int[LodUtil.MAX_NUMBER_OF_VERTICAL_LODS]); + put(Direction.NORTH, new int[LodUtil.MAX_NUMBER_OF_VERTICAL_LODS]); }}; culling = new boolean[6]; diff --git a/src/main/java/com/seibel/lod/builders/lodBuilding/LodBuilder.java b/src/main/java/com/seibel/lod/builders/lodBuilding/LodBuilder.java index 6ce2a231c..ef5acc98c 100644 --- a/src/main/java/com/seibel/lod/builders/lodBuilding/LodBuilder.java +++ b/src/main/java/com/seibel/lod/builders/lodBuilding/LodBuilder.java @@ -862,7 +862,7 @@ public class LodBuilder { case NETHER: - colorInt = LodUtil.NETHERRACK_COLOR_INT; + colorInt = Blocks.NETHERRACK.defaultBlockState().materialColor.col; break; case THEEND: diff --git a/src/main/java/com/seibel/lod/util/LodUtil.java b/src/main/java/com/seibel/lod/util/LodUtil.java index 705774da5..a8af87a8c 100644 --- a/src/main/java/com/seibel/lod/util/LodUtil.java +++ b/src/main/java/com/seibel/lod/util/LodUtil.java @@ -53,6 +53,9 @@ public class LodUtil private static MinecraftWrapper mc = MinecraftWrapper.INSTANCE; + /** The maximum number of LODs that can be rendered vertically */ + public static final int MAX_NUMBER_OF_VERTICAL_LODS = 32; + /** * alpha used when drawing chunks in debug mode */ @@ -61,19 +64,6 @@ public class LodUtil public static final Color COLOR_DEBUG_WHITE = new Color(255, 255, 255, DEBUG_ALPHA); public static final Color COLOR_INVISIBLE = new Color(0, 0, 0, 0); - /** - * a gray-purple color - */ - public static final int MYCELIUM_COLOR_INT = LodUtil.colorToInt(Color.decode("#6E6166")); - /** - * TODO, add a better way to override material colors - * and/or add a method to generate colors based on texture - * issue #64 - */ - public static final int STONE_COLOR_INT = LodUtil.colorToInt(new Color(150, 150, 150)); - public static final int NETHERRACK_COLOR_INT = LodUtil.colorToInt(new Color(95, 38, 38)); - public static final int WARPED_NYLIUM_COLOR_INT = LodUtil.colorToInt(new Color(34, 94, 85)); - public static final int CRIMSON_NYLIUM_COLOR_INT = LodUtil.colorToInt(new Color(126, 27, 27)); /** * In order of nearest to farthest: