mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
39 lines
2.2 KiB
Diff
39 lines
2.2 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockFence.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockFence.java
|
|
@@ -165,7 +165,10 @@
|
|
|
|
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
|
{
|
|
- return state.withProperty(NORTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.north(), EnumFacing.SOUTH))).withProperty(EAST, Boolean.valueOf(this.canConnectTo(worldIn, pos.east(), EnumFacing.WEST))).withProperty(SOUTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.south(), EnumFacing.NORTH))).withProperty(WEST, Boolean.valueOf(this.canConnectTo(worldIn, pos.west(), EnumFacing.EAST)));
|
|
+ return state.withProperty(NORTH, canFenceConnectTo(worldIn, pos, EnumFacing.NORTH))
|
|
+ .withProperty(EAST, canFenceConnectTo(worldIn, pos, EnumFacing.EAST))
|
|
+ .withProperty(SOUTH, canFenceConnectTo(worldIn, pos, EnumFacing.SOUTH))
|
|
+ .withProperty(WEST, canFenceConnectTo(worldIn, pos, EnumFacing.WEST));
|
|
}
|
|
|
|
public IBlockState withRotation(IBlockState state, Rotation rot)
|
|
@@ -201,6 +204,23 @@
|
|
return new BlockStateContainer(this, new IProperty[] {NORTH, EAST, WEST, SOUTH});
|
|
}
|
|
|
|
+ /* ======================================== FORGE START ======================================== */
|
|
+
|
|
+ @Override
|
|
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
|
+ {
|
|
+ return canConnectTo(world, pos.offset(facing), facing.getOpposite());
|
|
+ }
|
|
+
|
|
+ private boolean canFenceConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
|
+ {
|
|
+ BlockPos other = pos.offset(facing);
|
|
+ Block block = world.getBlockState(other).getBlock();
|
|
+ return block.canBeConnectedTo(world, other, facing.getOpposite()) || canConnectTo(world, other, facing.getOpposite());
|
|
+ }
|
|
+
|
|
+ /* ======================================== FORGE END ======================================== */
|
|
+
|
|
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
|
|
{
|
|
return face != EnumFacing.UP && face != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE : BlockFaceShape.CENTER;
|