From 71573a5e2fb139b0eef4c8b2a02fd797f2f1d923 Mon Sep 17 00:00:00 2001 From: Amnet Date: Sat, 10 Aug 2013 13:44:56 +0200 Subject: [PATCH] Fixed a crash involving saplings. --- .../biomesoplenty/blocks/BlockBOPColorizedSapling.java | 2 +- src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPColorizedSapling.java b/src/minecraft/biomesoplenty/blocks/BlockBOPColorizedSapling.java index 47a28f6d4..0e5a7fabb 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPColorizedSapling.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPColorizedSapling.java @@ -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 diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java b/src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java index 22a03d94e..2bcf6e247 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java @@ -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);