AppleCore

AppleCore

56M Downloads

Example for new API in Wiki

mainrs opened this issue ยท 1 comments

commented

Looks like you deprecated the old API methods from dispatcher. Would love to see some examples for the replacement. I am quite new to modding and don't really have a clue on how to use them.

commented

The replacement is the Forge events that do roughly the same thing. Specifically, AppleCore's AllowGrowthTick is replaced by CropGrowEvent.Pre, and AppleCore's GrowthTick is replaced by CropGrowEvent.Post.

For the dispatcher specifically, you can look at the implementation of the deprecated methods to see how they fire the Forge events (note: it would probably make more sense for you to use Forge's ForgeHooks.onCropsGrowPre and ForgeHooks.onCropsGrowPost methods instead of firing the events manually).

Hope that helps.