Fixed a crash with Thaumcraft. Closes #597
This commit is contained in:
parent
c25dcedc13
commit
41a40a5370
1 changed files with 10 additions and 5 deletions
|
@ -303,12 +303,17 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable
|
||||||
public void dropBlockAsItemWithChance(World world, BlockPos pos, IBlockState state, float chance, int fortune)
|
public void dropBlockAsItemWithChance(World world, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||||
{
|
{
|
||||||
EntityPlayer player = this.harvesters.get();
|
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);
|
super.dropBlockAsItemWithChance(world, pos, state, chance, fortune);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue