Added beds and chests to the blocks with special placement conditions

This commit is contained in:
Sollace 2019-02-05 11:01:49 +02:00
parent 33e121b3db
commit a3b0b7d507

View file

@ -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);