From 145479267dd3088fc6200eacd65905abe154f797 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Tue, 14 Sep 2021 13:15:36 +0200 Subject: [PATCH] Fixed Nether color --- .../com/seibel/lod/builders/LodBuilder.java | 22 ++++++++++++++----- .../com/seibel/lod/util/DataPointUtil.java | 2 +- .../java/com/seibel/lod/util/LodUtil.java | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/seibel/lod/builders/LodBuilder.java b/src/main/java/com/seibel/lod/builders/LodBuilder.java index 91a572959..99faf7fe3 100644 --- a/src/main/java/com/seibel/lod/builders/LodBuilder.java +++ b/src/main/java/com/seibel/lod/builders/LodBuilder.java @@ -546,6 +546,12 @@ public class LodBuilder } else if (blockState == Blocks.STONE.defaultBlockState()) { colorInt = LodUtil.STONE_COLOR_INT; + } else if (blockState == Blocks.NETHERRACK.defaultBlockState()) + { + colorInt = LodUtil.NETHERRACK_COLOR_INT; + } else if (blockState == Blocks.BEDROCK.defaultBlockState()) + { + colorInt = getColorForBiome(x, z, biome); } else if (blockState == Blocks.MYCELIUM.defaultBlockState()) { colorInt = LodUtil.MYCELIUM_COLOR_INT; @@ -605,7 +611,7 @@ public class LodBuilder { case NETHER: - colorInt = Blocks.BEDROCK.defaultBlockState().materialColor.col; + colorInt = LodUtil.NETHERRACK_COLOR_INT; break; case THEEND: @@ -665,17 +671,23 @@ public class LodBuilder BlockState blockState = chunk.getBlockState(blockPos); if (blockState != null) { - VoxelShape voxelShape = blockState.getShape(chunk, blockPos); - if(!voxelShape.isEmpty()){ + if (!blockState.getFluidState().isEmpty()) + { + return true; + } + VoxelShape voxelShape = blockState.getShape(chunk, blockPos); + if (!voxelShape.isEmpty()) + { AxisAlignedBB bbox = voxelShape.bounds(); int xWidth = (int) (bbox.maxX - bbox.minX); int yWidth = (int) (bbox.maxY - bbox.minY); int zWidth = (int) (bbox.maxZ - bbox.minZ); - if(xWidth < 0.7 && zWidth < 0.7 && yWidth < 1) + if (xWidth < 0.7 && zWidth < 0.7 && yWidth < 1) { return false; } - }else{ + } else + { return false; } if (blockState.getBlock() != Blocks.AIR diff --git a/src/main/java/com/seibel/lod/util/DataPointUtil.java b/src/main/java/com/seibel/lod/util/DataPointUtil.java index 1542a477f..04f38227b 100644 --- a/src/main/java/com/seibel/lod/util/DataPointUtil.java +++ b/src/main/java/com/seibel/lod/util/DataPointUtil.java @@ -36,7 +36,7 @@ public class DataPointUtil public final static long HEIGHT_MASK = 0b11_1111_1111; public final static long DEPTH_MASK = 0b11_1111_1111; public final static long LIGHT_MASK = 0b1111; - public final static long VERTICAL_INDEX_SHIFT = 0b11; + public final static long VERTICAL_INDEX_MASK = 0b11; public final static long GEN_TYPE_MASK = 0b111; public final static long VOID_MASK = 1; public final static long EXISTENCE_MASK = 1; diff --git a/src/main/java/com/seibel/lod/util/LodUtil.java b/src/main/java/com/seibel/lod/util/LodUtil.java index b6b881c3f..e074d0418 100644 --- a/src/main/java/com/seibel/lod/util/LodUtil.java +++ b/src/main/java/com/seibel/lod/util/LodUtil.java @@ -63,7 +63,7 @@ public class LodUtil * 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)); /** * In order of nearest to farthest:
* Red, Orange, Yellow, Green, Cyan, Blue, Magenta, white, gray, black