Skip to content

Commit

Permalink
revert 14b490e, Bump version to 1.2.1
Browse files Browse the repository at this point in the history
Fixes: #322
  • Loading branch information
1foxy2 committed Dec 10, 2024
1 parent 4bcae8d commit 1604b4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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<VoxelShape> original) {
return this.getBlock().getOcclusionShape(this.asState());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1604b4b

Please sign in to comment.