Made BlockStairs, BlockFarmland, and BlockStep have proper sided-solidity. Can now place torches on any solid side of those blocks.

This commit is contained in:
LexManos 2012-03-14 16:50:43 -07:00
parent dda4d3c93c
commit c0bf315876
2 changed files with 30 additions and 2 deletions

View File

@ -80,7 +80,7 @@
{
ItemStack var8 = this.createStackedBlock(par6);
@@ -1099,6 +1099,362 @@
@@ -1099,6 +1099,376 @@
*/
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {}
@ -141,6 +141,20 @@
+ */
+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, int side)
+ {
+ int meta = world.getBlockMetadata(x, y, z);
+ if (this instanceof BlockStep)
+ {
+ return (((meta & 8) == 8 && (side == 1)) || isOpaqueCube());
+ }
+ else if (this instanceof BlockFarmland)
+ {
+ return (side != 1 && side != 0);
+ }
+ else if (this instanceof BlockStairs)
+ {
+ boolean flipped = ((meta & 4) != 0);
+ return ((meta & 3) + side == 5) || (side == 1 && flipped);
+ }
+ return isBlockNormalCube(world, x, y, z);
+ }
+

View File

@ -68,7 +68,7 @@
{
ItemStack var8 = this.createStackedBlock(par6);
@@ -1010,6 +1012,362 @@
@@ -1010,6 +1012,376 @@
*/
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {}
@ -129,6 +129,20 @@
+ */
+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, int side)
+ {
+ int meta = world.getBlockMetadata(x, y, z);
+ if (this instanceof BlockStep)
+ {
+ return (((meta & 8) == 8 && (side == 1)) || isOpaqueCube());
+ }
+ else if (this instanceof BlockFarmland)
+ {
+ return (side != 1 && side != 0);
+ }
+ else if (this instanceof BlockStairs)
+ {
+ boolean flipped = ((meta & 4) != 0);
+ return ((meta & 3) + side == 5) || (side == 1 && flipped);
+ }
+ return isBlockNormalCube(world, x, y, z);
+ }
+