From 276d90b3e6db5d9020724130d9f76a9450366027 Mon Sep 17 00:00:00 2001 From: ada_aster Date: Wed, 17 Dec 2025 21:48:31 -0500 Subject: [PATCH 1/3] Slab Block Color Fix --- .../block/ClientBlockStateColorCache.java | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java index 79987701b..c2d95bd88 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java @@ -30,10 +30,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.core.Direction; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.FlowerBlock; -import net.minecraft.world.level.block.LeavesBlock; -import net.minecraft.world.level.block.RotatedPillarBlock; +import net.minecraft.world.level.block.*; #if MC_VER >= MC_1_19_2 import net.minecraft.util.RandomSource; #else @@ -41,6 +38,7 @@ import java.util.Random; #endif import net.minecraft.world.level.block.state.BlockState; import com.seibel.distanthorizons.core.logging.DhLogger; +import net.minecraft.world.level.block.state.properties.SlabType; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; @@ -282,24 +280,30 @@ public class ClientBlockStateColorCache private List getQuadsForDirection(@Nullable Direction direction) { List quads = null; + BlockState effectiveBlockState = this.blockState; - #if MC_VER < MC_1_21_5 - quads = Minecraft.getInstance().getModelManager().getBlockModelShaper(). - getBlockModel(this.blockState).getQuads(this.blockState, direction, RANDOM); - #else - List blockModelPartList = Minecraft.getInstance().getModelManager().getBlockModelShaper(). - getBlockModel(this.blockState).collectParts(RANDOM); - - quads = new ArrayList<>(); - if (blockModelPartList != null) + if (this.blockState.getBlock() instanceof SlabBlock) { - for (int i = 0; i < blockModelPartList.size(); i++) - { - // if direction is null this will return the unculled quads - quads.addAll(blockModelPartList.get(i).getQuads(direction)); - } + effectiveBlockState = this.blockState.setValue( SlabBlock.TYPE, SlabType.DOUBLE ); } - #endif + + #if MC_VER < MC_1_21_5 + quads = Minecraft.getInstance().getModelManager().getBlockModelShaper(). + getBlockModel(effectiveBlockState).getQuads(effectiveBlockState, direction, RANDOM); + #else + List blockModelPartList = Minecraft.getInstance().getModelManager().getBlockModelShaper(). + getBlockModel(effectiveBlockState).collectParts(RANDOM); + + quads = new ArrayList<>(); + if (blockModelPartList != null) + { + for (int i = 0; i < blockModelPartList.size(); i++) + { + // if direction is null this will return the unculled quads + quads.addAll(blockModelPartList.get(i).getQuads(direction)); + } + } + #endif return quads; } From 81b6a25805e27cda4787c95dc744378a7321dc27 Mon Sep 17 00:00:00 2001 From: ada_aster Date: Wed, 17 Dec 2025 22:08:45 -0500 Subject: [PATCH 2/3] Slab Block Color Fix --- .../common/wrappers/block/ClientBlockStateColorCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java index c2d95bd88..9c041dba1 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java @@ -293,7 +293,7 @@ public class ClientBlockStateColorCache #else List blockModelPartList = Minecraft.getInstance().getModelManager().getBlockModelShaper(). getBlockModel(effectiveBlockState).collectParts(RANDOM); - + quads = new ArrayList<>(); if (blockModelPartList != null) { From 5608db9c56a0284f72a3732d7e369348fdd0a4ce Mon Sep 17 00:00:00 2001 From: ada_aster Date: Wed, 17 Dec 2025 22:12:15 -0500 Subject: [PATCH 3/3] Slab Block Color Fix --- .../block/ClientBlockStateColorCache.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java index 9c041dba1..09edf4f55 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/ClientBlockStateColorCache.java @@ -286,24 +286,24 @@ public class ClientBlockStateColorCache { effectiveBlockState = this.blockState.setValue( SlabBlock.TYPE, SlabType.DOUBLE ); } - - #if MC_VER < MC_1_21_5 + + #if MC_VER < MC_1_21_5 quads = Minecraft.getInstance().getModelManager().getBlockModelShaper(). getBlockModel(effectiveBlockState).getQuads(effectiveBlockState, direction, RANDOM); - #else - List blockModelPartList = Minecraft.getInstance().getModelManager().getBlockModelShaper(). - getBlockModel(effectiveBlockState).collectParts(RANDOM); + #else + List blockModelPartList = Minecraft.getInstance().getModelManager().getBlockModelShaper(). + getBlockModel(effectiveBlockState).collectParts(RANDOM); - quads = new ArrayList<>(); - if (blockModelPartList != null) - { - for (int i = 0; i < blockModelPartList.size(); i++) - { - // if direction is null this will return the unculled quads - quads.addAll(blockModelPartList.get(i).getQuads(direction)); - } - } - #endif + quads = new ArrayList<>(); + if (blockModelPartList != null) + { + for (int i = 0; i < blockModelPartList.size(); i++) + { + // if direction is null this will return the unculled quads + quads.addAll(blockModelPartList.get(i).getQuads(direction)); + } + } + #endif return quads; }