mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Fixed cloud fences and banisters connecting to each other
This commit is contained in:
parent
58f72a783b
commit
6329d5bd59
2 changed files with 24 additions and 0 deletions
|
@ -52,6 +52,22 @@ public class BlockCloudBanister extends BlockCloudFence {
|
|||
return BlockRenderLayer.SOLID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing) {
|
||||
IBlockState myState = world.getBlockState(pos);
|
||||
|
||||
return myState.getBlock() instanceof BlockCloudBanister
|
||||
&& super.canConnectTo(world, pos, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing) {
|
||||
IBlockState state = world.getBlockState(pos.offset(facing));
|
||||
|
||||
return state.getBlock() instanceof BlockCloudBanister
|
||||
&& state.getMaterial() == world.getBlockState(pos).getMaterial();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entity, boolean isActualState) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
|
@ -83,6 +84,13 @@ public class BlockCloudFence extends BlockFence implements ICloudBlock {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing) {
|
||||
IBlockState myState = world.getBlockState(pos);
|
||||
|
||||
return !(myState.getBlock() instanceof BlockCloudBanister)
|
||||
&& super.canConnectTo(world, pos, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollision(World w, BlockPos pos, IBlockState state, Entity entity) {
|
||||
if (!applyBouncyness(state, entity)) {
|
||||
|
|
Loading…
Reference in a new issue