Fix some block connection logic not matching vanilla (#4781)
This commit is contained in:
parent
14a8e099ca
commit
fb61505d35
4 changed files with 28 additions and 31 deletions
|
@ -12,7 +12,7 @@
|
|||
}
|
||||
|
||||
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
|
||||
@@ -201,6 +204,37 @@
|
||||
@@ -201,6 +204,23 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176526_a, field_176525_b, field_176528_N, field_176527_M});
|
||||
}
|
||||
|
||||
|
@ -21,21 +21,7 @@
|
|||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+
|
||||
+ if(connector instanceof BlockFence)
|
||||
+ {
|
||||
+ if(this != Blocks.field_150386_bk && connector == Blocks.field_150386_bk)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ else if(this == Blocks.field_150386_bk && connector != Blocks.field_150386_bk)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ return func_176524_e(world, pos.func_177972_a(facing), facing.func_176734_d());
|
||||
+ }
|
||||
+
|
||||
+ private boolean canFenceConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
EnumFacing.Axis enumfacing$axis = ((EnumFacing)p_176221_1_.func_177229_b(field_185512_D)).func_176740_k();
|
||||
|
||||
- if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() == Blocks.field_150463_bK) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() == Blocks.field_150463_bK))
|
||||
+ if (enumfacing$axis == EnumFacing.Axis.Z && (canFenceGateConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST) || canFenceGateConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST)) || enumfacing$axis == EnumFacing.Axis.X && (canFenceGateConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH) || canFenceGateConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH)))
|
||||
+ if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() instanceof BlockWall) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() instanceof BlockWall))
|
||||
{
|
||||
p_176221_1_ = p_176221_1_.func_177226_a(field_176467_M, Boolean.valueOf(true));
|
||||
}
|
||||
|
@ -18,14 +18,14 @@
|
|||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+ return connector instanceof BlockFence || connector instanceof BlockWall;
|
||||
+ }
|
||||
+
|
||||
+ private boolean canFenceGateConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ Block block = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+ return block.canBeConnectedTo(world, pos.func_177972_a(facing), facing.func_176734_d());
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() instanceof BlockFenceGate &&
|
||||
+ state.func_193401_d(world, pos, facing) == BlockFaceShape.MIDDLE_POLE)
|
||||
+ {
|
||||
+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+ return connector instanceof BlockFence || connector instanceof BlockWall;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE END ======================================== */
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
|
||||
@@ -197,6 +197,24 @@
|
||||
@@ -112,7 +112,10 @@
|
||||
|
||||
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
|
||||
{
|
||||
- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()), p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()), p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()), p_176221_3_.func_177976_e(), EnumFacing.EAST))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()), p_176221_3_.func_177974_f(), EnumFacing.WEST)));
|
||||
+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
|
||||
+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
|
||||
+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST))
|
||||
+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST));
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -197,6 +200,24 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
|
||||
}
|
||||
|
||||
|
@ -9,8 +21,8 @@
|
|||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+ return connector instanceof BlockPane;
|
||||
+ BlockPos offset = pos.func_177972_a(facing);
|
||||
+ return func_193393_b(world, world.func_180495_p(offset), offset, facing.func_176734_d());
|
||||
+ }
|
||||
+
|
||||
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
boolean flag4 = flag && !flag1 && flag2 && !flag3 || !flag && flag1 && !flag2 && flag3;
|
||||
return p_176221_1_.func_177226_a(field_176256_a, Boolean.valueOf(!flag4 || !p_176221_2_.func_175623_d(p_176221_3_.func_177984_a()))).func_177226_a(field_176254_b, Boolean.valueOf(flag)).func_177226_a(field_176257_M, Boolean.valueOf(flag1)).func_177226_a(field_176258_N, Boolean.valueOf(flag2)).func_177226_a(field_176259_O, Boolean.valueOf(flag3));
|
||||
}
|
||||
@@ -177,6 +177,24 @@
|
||||
@@ -177,6 +177,23 @@
|
||||
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE_THICK : BlockFaceShape.CENTER_BIG;
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,7 @@
|
|||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+ return connector instanceof BlockWall || connector instanceof BlockFenceGate;
|
||||
+ return func_176253_e(world, pos.func_177972_a(facing), facing.func_176734_d());
|
||||
+ }
|
||||
+
|
||||
+ private boolean canWallConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
|
|
Loading…
Reference in a new issue