Skip to content

Commit

Permalink
Prevent Rails and Ladders from culling.
Browse files Browse the repository at this point in the history
Fix Leaves and Doors
Fixes #143

(cherry picked from commit beb866a)
  • Loading branch information
FxMorin committed Mar 17, 2023
1 parent d2db132 commit 63a351c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ca.fxco.moreculling.mixin.blocks;

import ca.fxco.moreculling.api.block.MoreBlockCulling;
import net.minecraft.block.AbstractRailBlock;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.Direction;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(AbstractRailBlock.class)
public class AbstractRailBlock_cullAgainstMixin implements MoreBlockCulling {

@Override
public boolean cantCullAgainst(BlockState state, Direction side) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class DoorBlock_cullAgainstMixin implements MoreBlockCulling {

@Override
public boolean cantCullAgainst(BlockState state, Direction side) {
return false;
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ca.fxco.moreculling.mixin.blocks;

import ca.fxco.moreculling.api.block.MoreBlockCulling;
import net.minecraft.block.BlockState;
import net.minecraft.block.LadderBlock;
import net.minecraft.util.math.Direction;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(LadderBlock.class)
public class LadderBlock_cullAgainstMixin implements MoreBlockCulling {

@Override
public boolean cantCullAgainst(BlockState state, Direction side) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ public boolean shouldAttemptToCull(BlockState state) {

@Override
public boolean cantCullAgainst(BlockState state, Direction side) {
return false;
return true;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/moreculling.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
"WorldRenderer_rainMixin",
"accessors.AbstractBlockAccessor",
"accessors.BlockModelsAccessor",
"blocks.AbstractRailBlock_cullAgainstMixin",
"blocks.ChorusFlowerBlock_voxelMixin",
"blocks.DoorBlock_cullAgainstMixin",
"blocks.FletchingTableBlock_devMixin",
"blocks.LadderBlock_cullAgainstMixin",
"blocks.LeavesBlock_typesMixin",
"blocks.MangroveRootsBlock_typesMixin",
"blocks.PowderSnowBlock_cullMixin",
Expand Down

0 comments on commit 63a351c

Please sign in to comment.