Merge pull request #607 from heldplayer/tripwires

Fix tripwire patches for solid side checks
This commit is contained in:
LexManos 2013-06-14 11:30:03 -07:00
commit ff95f73cd1

View file

@ -28,10 +28,10 @@
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{ {
- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); - return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1)));
+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH) || + return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST ) ||
+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH) || + par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST ) ||
+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST ) || + par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) ||
+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST ); + par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH);
} }
/** /**
@ -40,25 +40,25 @@
byte b0 = 0; byte b0 = 0;
- if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) - if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST, true)) + if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true))
{ {
b0 = 2; b0 = 2;
} }
- if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) - if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST, true)) + if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true))
{ {
b0 = 0; b0 = 0;
} }
- if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) - if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH, true)) + if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true))
{ {
b0 = 1; b0 = 1;
} }
- if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) - if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH, true)) + if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true))
{ {
b0 = 3; b0 = 3;
} }
@ -67,25 +67,25 @@
boolean flag = false; boolean flag = false;
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && j1 == 3) - if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && j1 == 3)
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH) && j1 == 3) + if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && j1 == 3)
{ {
flag = true; flag = true;
} }
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && j1 == 1) - if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && j1 == 1)
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH) && j1 == 1) + if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && j1 == 1)
{ {
flag = true; flag = true;
} }
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && j1 == 0) - if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && j1 == 0)
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST) && j1 == 0) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && j1 == 0)
{ {
flag = true; flag = true;
} }
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && j1 == 2) - if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && j1 == 2)
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST) && j1 == 2) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && j1 == 2)
{ {
flag = true; flag = true;
} }