From 41a40a53707e85a7ce7564ef810f5984d764159a Mon Sep 17 00:00:00 2001 From: Adubbz Date: Wed, 13 Jan 2016 09:26:51 +1100 Subject: [PATCH] Fixed a crash with Thaumcraft. Closes #597 --- .../common/block/BlockBOPFlower.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java b/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java index 432104a3c..0206beab3 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java @@ -303,12 +303,17 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable public void dropBlockAsItemWithChance(World world, BlockPos pos, IBlockState state, float chance, int fortune) { EntityPlayer player = this.harvesters.get(); - boolean usingShears = (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears); - - //Player must use shears when flowerDropsNeedShears is enabled - if (GameplayConfigurationHandler.flowerDropsNeedShears && !usingShears) - return; + //Only check if shears are being using if the appropriate option is enabled, and it's a player harvesting this block + if (GameplayConfigurationHandler.flowerDropsNeedShears && player != null) + { + boolean usingShears = (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears); + + //Player must use shears when flowerDropsNeedShears is enabled + if (!usingShears) + return; + } + super.dropBlockAsItemWithChance(world, pos, state, chance, fortune); }