Survival Inc.

Survival Inc.

7.5k Downloads

[Suggestion] Custom values for thirst based items

mxnmnm opened this issue ยท 7 comments

commented

It would be cool if we could have a config that would allow us to assign thirst values to food items from different mods. Sorta like what tough as nails does.

commented

Might be better to just add capabilities for foods and drinks and hooks via data tags for easy integration with simple foods. Haven't checked if already present but capabilities for the temperature modifiers (armor, food, etc) would be nice too.

commented

I thought that it might be more efficient in the long run to implement CraftTweaker API. Think of doing something like: mods.survivalinc.Stats.addConsumeEffect(<minecraft:apple>, [<stat:sanity> * 5, <stat:hydration> * 2.5])

commented

Capabilities are for other mod authors (like myself). CraftTweaker is for modpack authors and advanced players. Two different audience solutions imo. If I wanted to add support for your mod out-of-the-box w/ my mod, CraftTweaker does not allow me to do that.

commented

Oh, sorry. I forgot you are also a dev. Adding out of the box support will still be extremely easy for mod authors like you. Currently, you can register your items in this map and they will have their sanity value assigned. I plan to unify the process in the future, so only one map will be used for all kinds of modifiers.

I think it's more performance-efficient this way than having capabilities registered for each itemstack. What I mean that I may create a CraftTweaker API for interfacing indirectly with this map, so modpack authors can add support for non-natively supported items.

The capabilities solution would allow you to more clearly specify the conditions where the bonuses should apply and when not, but on the other hand, it would make providing CraftTweaker API for modpack authors nearly impossible to make. Also, it would be kind of memory hog, would introduce additional complexity to the codebase, and I honestly don't see a reason to do that, since the mentioned Capability would be just a bunch of getters anyway (for getting the amount of individual bonuses).

I apologize if I am missing your point.

commented

Np. It was just a suggestion based on the typical way of extending APIs to other mods vs pack-makers. As an aside, I'm not sure I understand the concern regarding memory/performance as every ItemStack already has a capabilities dispatcher associated with it. Actual capability support would be installed by the modded Item (not your mod unconditionally), so for the vast majority of items nothing changes just because you've defined a capability interface. Right? And also, why wouldn't the CraftTweaker extension simply use the Capability interfaces itself (say like for energy providers or inventory handlers or fluid handlers...) Tech mods/packs are swimming in capabilities and they seem to do allright :)

I get you though, for me Capabilities were a headache at first and they can seem rather convoluted until the particular API sinks into your brain. But they do really help with interoperability.

commented

I am planning on implementing all value mappings through such config. Expect to see this in the future releases. I'm going to leave this issue open until it is implemented.

commented

Okay a temporary fix was added in 0b3c8ce. A new system will probably replace this in the future.