private boolean applyBonemeal(World worldIn, BlockPos target, EntityPlayer player, ItemStack sigilStack) {
IBlockState iblockstate = worldIn.getBlockState(target);
BonemealEvent event = new BonemealEvent(player, worldIn, target, iblockstate, EnumHand.MAIN_HAND, sigilStack);
if (MinecraftForge.EVENT_BUS.post(event))
return false;
else if (event.getResult() == Result.ALLOW)
return true;
if (iblockstate.getBlock() instanceof IGrowable) {
IGrowable igrowable = (IGrowable) iblockstate.getBlock();
if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.isRemote)) {
if (!worldIn.isRemote) {
if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate))
igrowable.grow(worldIn, worldIn.rand, target, iblockstate);
}
return true;
}
}
return false;
}
}