Fixed a crash with Thaumcraft. Closes #597

This commit is contained in:
Adubbz 2016-01-13 09:26:51 +11:00
parent c25dcedc13
commit 41a40a5370

View file

@ -303,11 +303,16 @@ 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();
//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 (GameplayConfigurationHandler.flowerDropsNeedShears && !usingShears)
if (!usingShears)
return;
}
super.dropBlockAsItemWithChance(world, pos, state, chance, fortune);
}