diff --git a/src/main/java/com/minelittlepony/unicopia/block/BlockCloudBanister.java b/src/main/java/com/minelittlepony/unicopia/block/BlockCloudBanister.java index e9e0f0e9..0dfc7228 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/BlockCloudBanister.java +++ b/src/main/java/com/minelittlepony/unicopia/block/BlockCloudBanister.java @@ -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 collidingBoxes, @Nullable Entity entity, boolean isActualState) { diff --git a/src/main/java/com/minelittlepony/unicopia/block/BlockCloudFence.java b/src/main/java/com/minelittlepony/unicopia/block/BlockCloudFence.java index 5f5cc97d..598ac570 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/BlockCloudFence.java +++ b/src/main/java/com/minelittlepony/unicopia/block/BlockCloudFence.java @@ -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)) {