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

Wow you really wanted to rewrite the whole thing didn't you #105

Closed yeelp closed 2 years ago

yeelp commented 2 years ago

Yeah I did.

This has chances to fix #95 by completely rewriting the code that causes said unpredictable crash, and fix #104 by having Hearty Shanks undo death and starvation penalties, which are now caused by attributes instead of capabilities. Which entails...

This PR switches from using capabilities for managing max hunger to using attributes, which is a better system for this. The IFoodCap and IFoodCapModifier were already basically copying the IAttribute and AttributeModifier anyway, and with attributes, ScalingFeast doesn't need to worry about syncing values; that gets done automatically. Capabilities are still used for bloated hunger, and the starvation/exhaustion tracker.

This also lumps all such capability and attribute operations into a single class that wraps those operations with calls to sync capabilities to reduce clutter in code.

Config was cleaned up and reorganized to make much more sense.

this also adds SOL:Carrot Edition as a dependency in the build.gradle instead of using reflection because that was pretty silly.