mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-17 10:24:23 +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 com.minelittlepony.unicopia.forgebullshit.FUF;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockBed;
|
||||||
|
import net.minecraft.block.BlockChest;
|
||||||
import net.minecraft.block.BlockFalling;
|
import net.minecraft.block.BlockFalling;
|
||||||
import net.minecraft.block.BlockTorch;
|
import net.minecraft.block.BlockTorch;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
@ -45,7 +47,7 @@ public interface ICloudBlock {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block instanceof BlockTorch) {
|
if (isPlacementExcempt(block)) {
|
||||||
if (Predicates.INTERACT_WITH_CLOUDS.apply(player)) {
|
if (Predicates.INTERACT_WITH_CLOUDS.apply(player)) {
|
||||||
return type == CloudType.NORMAL;
|
return type == CloudType.NORMAL;
|
||||||
}
|
}
|
||||||
|
@ -61,6 +63,12 @@ public interface ICloudBlock {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default boolean isPlacementExcempt(Block block) {
|
||||||
|
return block instanceof BlockTorch
|
||||||
|
|| block instanceof BlockBed
|
||||||
|
|| block instanceof BlockChest;
|
||||||
|
}
|
||||||
|
|
||||||
default boolean applyLanding(Entity entity, float fallDistance) {
|
default boolean applyLanding(Entity entity, float fallDistance) {
|
||||||
if (!entity.isSneaking()) {
|
if (!entity.isSneaking()) {
|
||||||
entity.fall(fallDistance, 0);
|
entity.fall(fallDistance, 0);
|
||||||
|
|
Loading…
Reference in a new issue