mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
36 lines
2.1 KiB
Diff
36 lines
2.1 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockFenceGate.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockFenceGate.java
|
|
@@ -59,7 +59,7 @@
|
|
{
|
|
EnumFacing.Axis enumfacing$axis = ((EnumFacing)state.getValue(FACING)).getAxis();
|
|
|
|
- if (enumfacing$axis == EnumFacing.Axis.Z && (worldIn.getBlockState(pos.west()).getBlock() == Blocks.COBBLESTONE_WALL || worldIn.getBlockState(pos.east()).getBlock() == Blocks.COBBLESTONE_WALL) || enumfacing$axis == EnumFacing.Axis.X && (worldIn.getBlockState(pos.north()).getBlock() == Blocks.COBBLESTONE_WALL || worldIn.getBlockState(pos.south()).getBlock() == Blocks.COBBLESTONE_WALL))
|
|
+ if (enumfacing$axis == EnumFacing.Axis.Z && (worldIn.getBlockState(pos.west()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.east()).getBlock() instanceof BlockWall) || enumfacing$axis == EnumFacing.Axis.X && (worldIn.getBlockState(pos.north()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.south()).getBlock() instanceof BlockWall))
|
|
{
|
|
state = state.withProperty(IN_WALL, Boolean.valueOf(true));
|
|
}
|
|
@@ -192,6 +192,23 @@
|
|
return new BlockStateContainer(this, new IProperty[] {FACING, OPEN, POWERED, IN_WALL});
|
|
}
|
|
|
|
+ /* ======================================== FORGE START ======================================== */
|
|
+
|
|
+ @Override
|
|
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
|
+ {
|
|
+ IBlockState state = world.getBlockState(pos);
|
|
+ if (state.getBlock() instanceof BlockFenceGate &&
|
|
+ state.getBlockFaceShape(world, pos, facing) == BlockFaceShape.MIDDLE_POLE)
|
|
+ {
|
|
+ Block connector = world.getBlockState(pos.offset(facing)).getBlock();
|
|
+ return connector instanceof BlockFence || connector instanceof BlockWall;
|
|
+ }
|
|
+ return false;
|
|
+ }
|
|
+
|
|
+ /* ======================================== FORGE END ======================================== */
|
|
+
|
|
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
|
|
{
|
|
if (face != EnumFacing.UP && face != EnumFacing.DOWN)
|