diff --git a/common/src/main/java/ca/fxco/moreculling/mixin/models/cullshape/BlockStateBase_cullShapeMixin.java b/common/src/main/java/ca/fxco/moreculling/mixin/models/cullshape/BlockStateBase_cullShapeMixin.java index 966b576..954a735 100644 --- a/common/src/main/java/ca/fxco/moreculling/mixin/models/cullshape/BlockStateBase_cullShapeMixin.java +++ b/common/src/main/java/ca/fxco/moreculling/mixin/models/cullshape/BlockStateBase_cullShapeMixin.java @@ -1,26 +1,19 @@ package ca.fxco.moreculling.mixin.models.cullshape; import ca.fxco.moreculling.api.model.BakedOpacity; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import net.minecraft.client.resources.model.BakedModel; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.shapes.VoxelShape; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; import static ca.fxco.moreculling.MoreCulling.blockRenderManager; @Mixin(BlockBehaviour.BlockStateBase.class) -public abstract class BlockStateBase_cullShapeMixin { - - @Shadow public abstract Block getBlock(); - - @Shadow protected abstract BlockState asState(); +public class BlockStateBase_cullShapeMixin { @Redirect( method = "initCache", @@ -61,15 +54,4 @@ public abstract class BlockStateBase_cullShapeMixin { } return instance.getOcclusionShape(state); } - - @WrapOperation( - method = "initCache", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/world/phys/shapes/Shapes;empty()Lnet/minecraft/world/phys/shapes/VoxelShape;" - ) - ) - private VoxelShape moreculling$cacheOcclusionShape(Operation original) { - return this.getBlock().getOcclusionShape(this.asState()); - } } diff --git a/common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java b/common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java index e221cf7..81d333b 100644 --- a/common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java +++ b/common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java @@ -62,7 +62,11 @@ private static boolean shouldDrawFace(BlockGetter world, BlockState thisState, B } Direction opposite = side.getOpposite(); VoxelShape thisShape = thisState.getFaceOcclusionShape(side); + if (thisShape.isEmpty()) //vanilla 1.21.2 will just return empty if block cant occlude instead of its shape + thisShape = thisState.getBlock().getOcclusionShape(thisState).getFaceShape(side); VoxelShape sideShape = sideState.getFaceOcclusionShape(opposite); + if (sideShape.isEmpty()) + sideShape = sideState.getBlock().getOcclusionShape(sideState).getFaceShape(opposite); Block.ShapePairKey shapePairKey = new Block.ShapePairKey( thisShape, diff --git a/gradle.properties b/gradle.properties index dbd7aee..e7b930f 100755 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ neoforge_loader_version_range=[21.0.0-beta,) fabric_loader_version=0.16.9 # Mod Properties -mod_version=1.2.0 +mod_version=1.2.1 maven_group=ca.fxco.moreculling archives_base_name=moreculling license=GPL-3.0-only