From 3f19cce649a9ed2e412ee3a96b3364eeb82dd6fa Mon Sep 17 00:00:00 2001 From: gnembon <41132274+gnembon@users.noreply.github.com> Date: Thu, 2 Mar 2023 22:24:29 +0100 Subject: [PATCH] fixed chest stickyness --- .../carpet/mixins/ChestBlock_customStickyMixin.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/carpet/mixins/ChestBlock_customStickyMixin.java b/src/main/java/carpet/mixins/ChestBlock_customStickyMixin.java index 23b369ae..6b98c1f8 100644 --- a/src/main/java/carpet/mixins/ChestBlock_customStickyMixin.java +++ b/src/main/java/carpet/mixins/ChestBlock_customStickyMixin.java @@ -13,6 +13,8 @@ import net.minecraft.world.level.block.ChestBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.ChestType; +import static net.minecraft.world.level.block.ChestBlock.getConnectedDirection; + @Mixin(ChestBlock.class) public class ChestBlock_customStickyMixin implements BlockBehaviourInterface { @@ -33,13 +35,6 @@ public class ChestBlock_customStickyMixin implements BlockBehaviourInterface { if (type == ChestType.SINGLE || neighborType == ChestType.SINGLE) { return false; } - if (type != neighborType.getOpposite()) { - return false; - } - - Direction facing = state.getValue(ChestBlock.FACING); - Direction neighborFacing = state.getValue(ChestBlock.FACING); - - return facing == neighborFacing; + return getConnectedDirection(state) == dir; } }