diff --git a/src/main/java/carpet/mixins/PistonHandler_movableTEMixin.java b/src/main/java/carpet/mixins/PistonHandler_movableTEMixin.java index e8d29602..81e2e7b8 100644 --- a/src/main/java/carpet/mixins/PistonHandler_movableTEMixin.java +++ b/src/main/java/carpet/mixins/PistonHandler_movableTEMixin.java @@ -41,6 +41,10 @@ public abstract class PistonHandler_movableTEMixin * @author 2No2Name */ private void stickToStickySide(BlockPos blockPos_1, Direction direction_1, CallbackInfoReturnable cir, BlockState blockState_1, Block block_1, int int_1, int int_2, int int_4, BlockPos blockPos_3, int int_5, int int_6){ + if (CarpetSettings.stickyHoney && this.world.getBlockState(blockPos_1).getBlock() == Blocks.GOLD_BLOCK && !method_11538(blockPos_1)) { + cir.setReturnValue(false); + return; + } if(!stickToStickySide(blockPos_3)){ cir.setReturnValue(false); cir.cancel(); @@ -53,7 +57,13 @@ public abstract class PistonHandler_movableTEMixin * @author 2No2Name */ private void stickToStickySide(CallbackInfoReturnable cir, int int_1){ - if(!stickToStickySide(this.movedBlocks.get(int_1))){ + BlockPos pos = this.movedBlocks.get(int_1); + if (CarpetSettings.stickyHoney && world.getBlockState(pos).getBlock() == Blocks.GOLD_BLOCK) + { + cir.setReturnValue(false); + return; + } + if(!stickToStickySide(pos)){ cir.setReturnValue(false); cir.cancel(); } @@ -88,6 +98,9 @@ public abstract class PistonHandler_movableTEMixin //Get access to the blockstate to check if it is a chest @Shadow @Final private Direction direction; + + @Shadow protected abstract boolean method_11538(BlockPos blockPos_1); + private BlockState blockState_1; @Redirect(method = "tryMove", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getBlockState(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;", ordinal = 0))