From a3b0b7d50758b486d949700d01f46a41ceb2f600 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 5 Feb 2019 11:01:49 +0200 Subject: [PATCH] Added beds and chests to the blocks with special placement conditions --- .../com/minelittlepony/unicopia/block/ICloudBlock.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java index c0a65277..ca146dcc 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java @@ -6,6 +6,8 @@ import com.minelittlepony.unicopia.UClient; import com.minelittlepony.unicopia.forgebullshit.FUF; import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.BlockChest; import net.minecraft.block.BlockFalling; import net.minecraft.block.BlockTorch; import net.minecraft.block.state.IBlockState; @@ -45,7 +47,7 @@ public interface ICloudBlock { return false; } - if (block instanceof BlockTorch) { + if (isPlacementExcempt(block)) { if (Predicates.INTERACT_WITH_CLOUDS.apply(player)) { return type == CloudType.NORMAL; } @@ -61,6 +63,12 @@ public interface ICloudBlock { return false; } + default boolean isPlacementExcempt(Block block) { + return block instanceof BlockTorch + || block instanceof BlockBed + || block instanceof BlockChest; + } + default boolean applyLanding(Entity entity, float fallDistance) { if (!entity.isSneaking()) { entity.fall(fallDistance, 0);