Fix mobs spawning on inverted slabs/stairs.

This commit is contained in:
LexManos 2012-12-27 13:50:13 -08:00
parent 081ec4b70a
commit 46440588fe
2 changed files with 4 additions and 17 deletions

View file

@ -33,6 +33,7 @@ public class MinecraftForge
public static final EventBus EVENT_BUS = new EventBus();
public static final EventBus TERRAIN_GEN_BUS = new EventBus();
public static final EventBus ORE_GEN_BUS = new EventBus();
@Deprecated //Vanilla feature now
public static boolean SPAWNER_ALLOW_ON_INVERTED = false;
private static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();

View file

@ -141,7 +141,7 @@
{
ItemStack var8 = this.createStackedBlock(par6);
@@ -1356,4 +1372,849 @@
@@ -1356,4 +1372,835 @@
canBlockGrass[0] = true;
StatList.initBreakableStats();
}
@ -511,25 +511,11 @@
+ int meta = world.getBlockMetadata(x, y, z);
+ if (this instanceof BlockStep)
+ {
+ if (MinecraftForge.SPAWNER_ALLOW_ON_INVERTED)
+ {
+ return (((meta & 8) == 8) || isOpaqueCube());
+ }
+ else
+ {
+ return isNormalCube(this.blockID);
+ }
+ return (((meta & 8) == 8) || isOpaqueCube());
+ }
+ else if (this instanceof BlockStairs)
+ {
+ if (MinecraftForge.SPAWNER_ALLOW_ON_INVERTED)
+ {
+ return ((meta & 4) != 0);
+ }
+ else
+ {
+ return isNormalCube(this.blockID);
+ }
+ return ((meta & 4) != 0);
+ }
+ return isBlockSolidOnSide(world, x, y, z, UP);
+ }