From 480d86c5add2feeeed15f9f47bd9cc3a0b882633 Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Tue, 18 May 2021 18:50:54 -0700 Subject: [PATCH] Fix beds on contraptions - Add beds tag to brittle tag - Let contraptions know bed halves are attached to each other --- src/main/java/com/simibubi/create/AllTags.java | 1 + .../structureMovement/BlockMovementTraits.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index b42cdf120..231973559 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -209,6 +209,7 @@ public class AllTags { AllBlockTags.WINDMILL_SAILS.includeAll(BlockTags.WOOL); AllBlockTags.BRITTLE.includeAll(BlockTags.DOORS); + AllBlockTags.BRITTLE.includeAll(BlockTags.BEDS); AllBlockTags.BRITTLE.add(Blocks.FLOWER_POT, Blocks.BELL, Blocks.COCOA); AllBlockTags.FAN_TRANSPARENT.includeAll(BlockTags.FENCES); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java index 5a47573fe..a7bfd1806 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java @@ -29,6 +29,7 @@ import com.simibubi.create.content.logistics.block.redstone.RedstoneLinkBlock; import net.minecraft.block.AbstractPressurePlateBlock; import net.minecraft.block.AbstractRailBlock; import net.minecraft.block.AbstractSignBlock; +import net.minecraft.block.BedBlock; import net.minecraft.block.BellBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -49,6 +50,7 @@ import net.minecraft.block.WallSignBlock; import net.minecraft.block.WallTorchBlock; import net.minecraft.block.material.PushReaction; import net.minecraft.state.properties.AttachFace; +import net.minecraft.state.properties.BedPart; import net.minecraft.state.properties.BellAttachment; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; @@ -163,6 +165,13 @@ public class BlockMovementTraits { return direction == Direction.DOWN; if (block instanceof DoorBlock) return direction == Direction.DOWN; + if (block instanceof BedBlock) { + Direction facing = state.get(BedBlock.HORIZONTAL_FACING); + if (state.get(BedBlock.PART) == BedPart.HEAD) { + facing = facing.getOpposite(); + } + return direction == facing; + } if (block instanceof RedstoneLinkBlock) return direction.getOpposite() == state.get(RedstoneLinkBlock.FACING); if (block instanceof FlowerPotBlock)