yeelp / Scaling-Feast

A simple, balanced way to increase your maximum hunger in Minecraft over the course of a world.
MIT License
0 stars 1 forks source link

Improve FoodCapModifier #71

Closed yeelp closed 4 years ago

yeelp commented 4 years ago

To implement Hunger Plus/Minus easily, I'd need to use the FoodCapModifier capability. However, the FoodCapModifier can't distinguish between the different modifiers (from modules, hunger plus/minus) which may cause errors in setting the final modifier value. This PR attempts to fix this while preserving compatibility with 1.4.0 and below.

If this doesn't work (I hope this does as I have no ideas after this), I'm going to continue to document my attempts in this PR. If this DOES work, I'm merging this into the 1.5.0 dev branch.

yeelp commented 4 years ago

Thankfully, this works. NBTExplorer shows that the FoodCapModifier is stored as an NBTTagList (although it has 0 entries... strange). The world I used for 1.4.0 development was loaded successfully without crashing, and it kept my original FoodCapModifier, so I say this was a successful update.