From 2dcdc854e32722fe83203d66507dd8244663f99f Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 29 Aug 2021 21:09:30 -0500 Subject: [PATCH] Improve stone color --- .../java/com/seibel/lod/builders/LodBuilder.java | 12 ++++++++---- src/main/java/com/seibel/lod/util/LodUtil.java | 8 ++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/seibel/lod/builders/LodBuilder.java b/src/main/java/com/seibel/lod/builders/LodBuilder.java index 5663743b1..7f301dc90 100644 --- a/src/main/java/com/seibel/lod/builders/LodBuilder.java +++ b/src/main/java/com/seibel/lod/builders/LodBuilder.java @@ -46,7 +46,6 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkSection; import net.minecraft.world.chunk.IChunk; import net.minecraft.world.gen.Heightmap; -import org.lwjgl.system.CallbackI; /** * This object is in charge of creating Lod related objects. (specifically: Lod @@ -54,7 +53,7 @@ import org.lwjgl.system.CallbackI; * * @author Leonardo Amato * @author James Seibel - * @version 8-26-2021 + * @version 8-29-2021 */ public class LodBuilder { @@ -421,7 +420,7 @@ public class LodBuilder } /** - * Returns a color int for a given block. + * Returns a color int for the given block. */ private int getColorForBlock(int x, int z, BlockState blockState, Biome biome) { @@ -433,7 +432,12 @@ public class LodBuilder Color tmp = LodUtil.intToColor(biome.getGrassColor(x, z)); tmp = tmp.darker(); colorInt = LodUtil.colorToInt(tmp); - } else if (blockState == Blocks.MYCELIUM.defaultBlockState()) + } + else if (blockState == Blocks.STONE.defaultBlockState()) + { + colorInt = LodUtil.STONE_COLOR_INT; + } + else if (blockState == Blocks.MYCELIUM.defaultBlockState()) { colorInt = LodUtil.MYCELIUM_COLOR_INT; } diff --git a/src/main/java/com/seibel/lod/util/LodUtil.java b/src/main/java/com/seibel/lod/util/LodUtil.java index aaed6b74c..313ad01c7 100644 --- a/src/main/java/com/seibel/lod/util/LodUtil.java +++ b/src/main/java/com/seibel/lod/util/LodUtil.java @@ -21,9 +21,9 @@ import java.awt.Color; import java.io.File; import java.util.HashSet; -import com.seibel.lod.objects.LevelPos.LevelPos; import com.seibel.lod.objects.LodDimension; import com.seibel.lod.objects.RegionPos; +import com.seibel.lod.objects.LevelPos.LevelPos; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ServerData; @@ -43,7 +43,7 @@ import net.minecraft.world.server.ServerWorld; * This class holds methods and constants that may be used in multiple places. * * @author James Seibel - * @version 8-11-2021 + * @version 8-29-2021 */ public class LodUtil { @@ -58,6 +58,10 @@ public class LodUtil /** 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)); /** * In order of nearest to farthest: