Skip to content

Commit

Permalink
fix BlockMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
isXander committed Dec 15, 2022
1 parent ef312af commit 964997d
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import dev.isxander.culllessleaves.CullLessLeaves;
import me.fallenbreath.conditionalmixin.api.annotation.Condition;
import me.fallenbreath.conditionalmixin.api.annotation.Restriction;
import dev.isxander.culllessleaves.compat.Compat;
import net.minecraft.block.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Restriction(conflict = { @Condition("moreculling"), @Condition("sodium") })
@Mixin(Block.class)
public class BlockMixin {
@ModifyExpressionValue(method = "shouldDrawSide", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isSideInvisible(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;)Z"))
private static boolean shouldCullLeafSide(boolean isSideInvisible, BlockState state, BlockView world, BlockPos pos, Direction side, BlockPos blockPos) {
if (!(state.getBlock() instanceof LeavesBlock) || !CullLessLeaves.getConfig().enabled)
if (!(state.getBlock() instanceof LeavesBlock) || !CullLessLeaves.getConfig().enabled || Compat.SODIUM)
return isSideInvisible;

return CullLessLeaves.shouldCullSide(world, pos, side);
Expand Down

0 comments on commit 964997d

Please sign in to comment.