diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java index 55d86719c..dce0411c2 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java @@ -26,6 +26,7 @@ import com.simibubi.create.modules.logistics.block.transposer.TransposerBlock; import net.minecraft.block.AbstractPressurePlateBlock; import net.minecraft.block.AbstractRailBlock; +import net.minecraft.block.BellBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -33,6 +34,7 @@ import net.minecraft.block.CarpetBlock; import net.minecraft.block.DoorBlock; import net.minecraft.block.FenceGateBlock; import net.minecraft.block.FlowerPotBlock; +import net.minecraft.block.HorizontalBlock; import net.minecraft.block.HorizontalFaceBlock; import net.minecraft.block.LadderBlock; import net.minecraft.block.RedstoneDiodeBlock; @@ -42,6 +44,7 @@ import net.minecraft.block.TorchBlock; import net.minecraft.block.WallTorchBlock; import net.minecraft.block.material.PushReaction; import net.minecraft.state.properties.AttachFace; +import net.minecraft.state.properties.BellAttachment; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; @@ -145,6 +148,8 @@ public class BlockMovementTraits { return true; if (block instanceof CarpetBlock) return true; + if (block instanceof BellBlock) + return true; return false; } @@ -198,6 +203,16 @@ public class BlockMovementTraits { return direction == state.get(NozzleBlock.FACING).getOpposite(); if (block instanceof EngineBlock) return direction == state.get(EngineBlock.HORIZONTAL_FACING).getOpposite(); + if (block instanceof BellBlock) { + BellAttachment attachment = state.get(BlockStateProperties.BELL_ATTACHMENT); + if (attachment == BellAttachment.FLOOR) { + return direction == Direction.DOWN; + } + if (attachment == BellAttachment.CEILING) { + return direction == Direction.UP; + } + return direction == state.get(HorizontalBlock.HORIZONTAL_FACING); + } return false; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/StructureTransform.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/StructureTransform.java index 1b3109e36..fe2e7b15d 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/StructureTransform.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/StructureTransform.java @@ -12,6 +12,7 @@ import com.simibubi.create.modules.contraptions.components.contraptions.chassis. import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Slope; +import net.minecraft.block.BellBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalFaceBlock; @@ -19,6 +20,8 @@ import net.minecraft.block.SlabBlock; import net.minecraft.block.StairsBlock; import net.minecraft.state.BooleanProperty; import net.minecraft.state.properties.AttachFace; +import net.minecraft.state.properties.BellAttachment; +import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.Half; import net.minecraft.state.properties.SlabType; import net.minecraft.util.Direction; @@ -78,11 +81,18 @@ public class StructureTransform { * horizontal axes */ public BlockState apply(BlockState state) { - if (rotationAxis == Axis.Y) - return state.rotate(rotation); - Block block = state.getBlock(); + if (rotationAxis == Axis.Y) { + if (block instanceof BellBlock) { + if (state.get(BlockStateProperties.BELL_ATTACHMENT) == BellAttachment.DOUBLE_WALL) { + state = state.with(BlockStateProperties.BELL_ATTACHMENT, BellAttachment.SINGLE_WALL); + } + return state.with(HorizontalFaceBlock.HORIZONTAL_FACING, rotation.rotate(state.get(HorizontalFaceBlock.HORIZONTAL_FACING))); + } + return state.rotate(rotation); + } + if (block instanceof AbstractChassisBlock) return rotateChassis(state);