mirror of
https://github.com/TeamMidnightDust/CullLeaves.git
synced 2025-12-16 06:15:08 +01:00
port: Spring to Life (1.21.5)
This commit is contained in:
@@ -5,7 +5,7 @@ import net.caffeinemc.mods.sodium.client.render.chunk.compile.pipeline.BlockRend
|
||||
import net.caffeinemc.mods.sodium.client.render.frapi.render.AbstractBlockRenderContext;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.BlockStateModel;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@Mixin(BlockRenderer.class)
|
||||
public abstract class MixinBlockRenderer extends AbstractBlockRenderContext {
|
||||
@Inject(at = @At("HEAD"), method = "renderModel", cancellable = true)
|
||||
public void cullleaves$cancelRendering(BakedModel model, BlockState state, BlockPos pos, BlockPos origin, CallbackInfo ci) {
|
||||
public void cullleaves$cancelRendering(BlockStateModel model, BlockState state, BlockPos pos, BlockPos origin, CallbackInfo ci) {
|
||||
if (state.getBlock() instanceof LeavesBlock && CullLeavesClient.shouldHideBlock(this.level, pos))
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user