Fixed a crash involving saplings.

This commit is contained in:
Amnet 2013-08-10 13:44:56 +02:00
parent 16af6545b9
commit 71573a5e2f
2 changed files with 3 additions and 3 deletions

View file

@ -74,7 +74,7 @@ public class BlockBOPColorizedSapling extends BlockSapling
int id = world.getBlockId(x, y - 1, z);
int meta = itemStack.getItemDamage();
if (itemStack.itemID == blockID) {
if (itemStack.itemID == blockID && id != 0) {
switch (meta)
{
case 1: // Mangrove

View file

@ -81,14 +81,14 @@ public class BlockBOPSapling extends BlockSapling
int id = world.getBlockId(x, y - 1, z);
int meta = itemStack.getItemDamage();
if (itemStack.itemID == blockID) {
if (itemStack.itemID == blockID && id != 0) {
switch (meta)
{
case 7: // Loftwood
return id == Blocks.holyGrass.get().blockID || id == Block.grass.blockID;
default:
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID /*|| blocksList[id].canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this)*/;
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID || blocksList[id].canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this);
}
} else
return this.canPlaceBlockOnSide(world, x, y, z, side);