From 4f0dc0799516376edae75b8567aa25451f276d61 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 5 Jan 2026 07:48:34 -0600 Subject: [PATCH] Minor refactoring after slab color fix merge --- .../wrappers/block/ClientBlockStateColorCache.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 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 09edf4f55..f13d36343 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 @@ -62,6 +62,8 @@ public class ClientBlockStateColorCache { private static final DhLogger LOGGER = new DhLoggerBuilder().build(); + private static final Minecraft MC = Minecraft.getInstance(); + private static final HashSet BLOCK_STATES_THAT_NEED_LEVEL = new HashSet<>(); private static final HashSet BROKEN_BLOCK_STATES = new HashSet<>(); @@ -279,22 +281,23 @@ public class ClientBlockStateColorCache @Nullable private List getQuadsForDirection(@Nullable Direction direction) { - List quads = null; BlockState effectiveBlockState = this.blockState; + // if this block is a slab, use it's double variant so we can get the top face, + // otherwise the color will use the side, which isn't as accurate if (this.blockState.getBlock() instanceof SlabBlock) { effectiveBlockState = this.blockState.setValue( SlabBlock.TYPE, SlabType.DOUBLE ); } #if MC_VER < MC_1_21_5 - quads = Minecraft.getInstance().getModelManager().getBlockModelShaper(). + quads = MC.getModelManager().getBlockModelShaper(). getBlockModel(effectiveBlockState).getQuads(effectiveBlockState, direction, RANDOM); #else - List blockModelPartList = Minecraft.getInstance().getModelManager().getBlockModelShaper(). + List blockModelPartList = MC.getModelManager().getBlockModelShaper(). getBlockModel(effectiveBlockState).collectParts(RANDOM); - quads = new ArrayList<>(); + List quads = new ArrayList<>(); if (blockModelPartList != null) { for (int i = 0; i < blockModelPartList.size(); i++)