GregTechCEu / Gregification

(1.12) Adding compat for GregTech to all the mods
MIT License
16 stars 22 forks source link

TerraFirmaCraft Food Compatibility for MetaItems #27

Closed bruberu closed 2 years ago

bruberu commented 2 years ago

Allows for MetaItem food to give hunger and saturation as usual with TerraFirmaCraft installed, as well as have nutrition and heating properties.

This is done through the ITFCFoodComponent interface, which gives TFC's CapabilityFood to ItemStacks with this component. Implementations of this are expected to include a call to player.getFoodStats().addStats(null, stack) within their onFoodEaten() overrides, so that TFC can access the capability.

Add-ons (such as my own GTFO) will have to either implement this interface, or extend its default implementation, TFCFoodComponent, when creating their own FoodStats.

bruberu commented 2 years ago

Sorry to get back so late; I think an IMC setup would probably work much better (especially given how it's hard to make a PR here every time I want to update nutrition stats for GTFO items). I'll try my hand at putting in the IMC myself.