mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-17 10:24:23 +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;
|
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
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entity, boolean isActualState) {
|
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.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
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
|
@Override
|
||||||
public void onEntityCollision(World w, BlockPos pos, IBlockState state, Entity entity) {
|
public void onEntityCollision(World w, BlockPos pos, IBlockState state, Entity entity) {
|
||||||
if (!applyBouncyness(state, entity)) {
|
if (!applyBouncyness(state, entity)) {
|
||||||
|
|
Loading…
Reference in a new issue