Hardcode leaves to solid layers

This commit is contained in:
mcrcortex
2025-05-23 12:10:14 +10:00
parent a1ace12042
commit 74dac668fb
2 changed files with 12 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ import me.cortex.voxy.common.world.other.Mapper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.FluidBlock;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.color.block.BlockColorProvider;
@@ -258,7 +259,11 @@ public class ModelFactory {
if (blockState.getBlock() instanceof FluidBlock) {
blockRenderLayer = RenderLayers.getFluidLayer(blockState.getFluidState());
} else {
blockRenderLayer = RenderLayers.getBlockLayer(blockState);
if (blockState.getBlock() instanceof LeavesBlock) {
blockRenderLayer = RenderLayer.getSolid();
} else {
blockRenderLayer = RenderLayers.getBlockLayer(blockState);
}
}

View File

@@ -3,6 +3,7 @@ package me.cortex.voxy.client.core.model.bakery;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.FluidBlock;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.RenderLayer;
@@ -166,7 +167,11 @@ public class ModelTextureBakery {
layer = RenderLayers.getFluidLayer(state.getFluidState());
isBlock = false;
} else {
layer = RenderLayers.getBlockLayer(state);
if (state.getBlock() instanceof LeavesBlock) {
layer = RenderLayer.getSolid();
} else {
layer = RenderLayers.getBlockLayer(state);
}
}
//TODO: support block model entities