Fixed a crash involving saplings.
This commit is contained in:
parent
16af6545b9
commit
71573a5e2f
|
@ -74,7 +74,7 @@ public class BlockBOPColorizedSapling extends BlockSapling
|
||||||
int id = world.getBlockId(x, y - 1, z);
|
int id = world.getBlockId(x, y - 1, z);
|
||||||
int meta = itemStack.getItemDamage();
|
int meta = itemStack.getItemDamage();
|
||||||
|
|
||||||
if (itemStack.itemID == blockID) {
|
if (itemStack.itemID == blockID && id != 0) {
|
||||||
switch (meta)
|
switch (meta)
|
||||||
{
|
{
|
||||||
case 1: // Mangrove
|
case 1: // Mangrove
|
||||||
|
|
|
@ -81,14 +81,14 @@ public class BlockBOPSapling extends BlockSapling
|
||||||
int id = world.getBlockId(x, y - 1, z);
|
int id = world.getBlockId(x, y - 1, z);
|
||||||
int meta = itemStack.getItemDamage();
|
int meta = itemStack.getItemDamage();
|
||||||
|
|
||||||
if (itemStack.itemID == blockID) {
|
if (itemStack.itemID == blockID && id != 0) {
|
||||||
switch (meta)
|
switch (meta)
|
||||||
{
|
{
|
||||||
case 7: // Loftwood
|
case 7: // Loftwood
|
||||||
return id == Blocks.holyGrass.get().blockID || id == Block.grass.blockID;
|
return id == Blocks.holyGrass.get().blockID || id == Block.grass.blockID;
|
||||||
|
|
||||||
default:
|
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
|
} else
|
||||||
return this.canPlaceBlockOnSide(world, x, y, z, side);
|
return this.canPlaceBlockOnSide(world, x, y, z, side);
|
||||||
|
|
Loading…
Reference in New Issue