AppleCore

AppleCore

56M Downloads

[1.8.9] Rethink PlantGrowthEvent fields

squeek502 opened this issue ยท 1 comments

commented

A few options here:

  1. Continue using int previousMetadata, and have it always store the int value of the specific PropertyInteger used for growth stages. This is probably the most prone to error, as there is no standardization between Blocks
  2. Continue using int previousMetadata, and have it always store the int returned from Block.getMetaFromState(IBlockState). This would basically allow for the exact same functionaltiy as 1.7.10, and would make it easy to standardize between blocks.
  3. Change int previousMetadata to IBlockState previousState and then make sure that the IBlockState instance is not mutated after the fact. I don't know enough about IBlockStates to know what would be involved in this.
  4. A hybrid of option 2 and 3, where the return value of Block.getMetaFromState is given to the PlantGrowthEvent constructor, and then transformed back into IBlockState using Block.getStateFromMeta before storing it in an IBlockState previousState field.

Right now I'm leaning towards option 2 or 4 as it seems like they'd be the simplest.

commented

Went with option 3, as integer metadata seems to be disfavored heavily in 1.8+.