Wiki 9Minecraft Applecore Wiki
Applecore WikiDocumentation › Integrating Plants With Applecore

Integrating Plants With Applecore

Note: Deprecated in Minecraft 1.10.2+

In Minecraft versions 1.10.2 and newer, AppleCore's plant growth events have been deprecated in favor of Forge's net.minecraftforge.event.world.BlockEvent.CropGrowEvent


Plant Growth Ticks

Note: This is only relevant if your Block class either does not extend BlockCrops or overrides BlockCrops.updateTick without calling super.updateTick. If you use the default BlockCrops.updateTick implementation, your plant growth ticks will fire the relevant AppleCore events automatically.

A general checklist for manual integration:

  • For each attempted growth tick of your plant, AppleCore's PlantGrowthEvent.AllowGrowthTick should be fired (this can be done by calling AppleCoreAPI.dispatcher.validatePlantGrowth).
  • The result of the PlantGrowthEvent.AllowGrowthTick event should be handled in the following way:
  • Event.Result.ALLOW: always allow the growth tick without condition
  • Event.Result.DEFAULT: continue with the conditionals as normal
  • Event.Result.DENY: always disallow the growth tick
  • After a successful growth tick (and its effects), AppleCore's PlantGrowthEvent.GrowthTick should be fired (this can be done by calling AppleCoreAPI.dispatcher.announcePlantGrowth).

An example implementation can be found here:

  • squeek/applecore/example/BlockCropsExample.java