Fertilizable plants/blocks by implementing "IGrowable"

Status
Migrated
Issue description

Although there's a global trigger "When bonemeal used", it can be confusing to use a single procedure to control many different blocks. Creating a procedure for each block would instead clog up the element list. By implementing the interface "IGrowable", it's possible to make a block bonemeal-able. The methods that need to be overridden are:

// Whether bonemeal can be used on the plant
// Will also automatically consume bonemeal and spawn particles
public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) {
	return true;
}

// Whether it should call the grow method
// Can be used as a "Success rate" method
// For example, the event can be triggered 50% of the times with the line
// return rand.nextDouble() < 0.5D;
public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) {
	return true;
}

// Perform the effect. Can pass world, x, y, z to procedures
// The bonemeal is consumed instantly
public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) {
}

By using IGrowable, it would also be possible to have a "Is block fertilizable" procedure block, by checking if its class implements IGrowable (although I'm not sure how to do that)

Issue comments

I will consider adding this.

For the single procedure, though, you can use the same global trigger in multiple procedures if you want to make things cleaner for now.