mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Added beds and chests to the blocks with special placement conditions
This commit is contained in:
parent
33e121b3db
commit
a3b0b7d507
1 changed files with 9 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue