Mrbysco / Spoiled

Spoiling the end of your food supply since 2020
https://www.curseforge.com/minecraft/mc-mods/spoiled
MIT License
7 stars 5 forks source link

[Suggestion]: Allow food to spoil in unloaded chunks #43

Open Void-0000 opened 8 months ago

Void-0000 commented 8 months ago

General Info

Suggestion Description

This could be done by basing spoiling on an "expiry date" instead of a timer, by storing the time the item was created and comparing it to the current time every now and again to update its status. This way, items don't need to be loaded to spoil.

Alternatively, if the current timer system has advantages I've missed (or just to simplify), storing the last timer increment time and recalculating the timers based on that whenever a chunk loads could work as well.

Mrbysco commented 8 months ago

If you apply the time it was created it'll make food even less stackable than it already is in the current system

Void-0000 commented 8 months ago

Oh, that makes sense, I hadn't thought of that. What about a "rounded" creation time? If you turn up the rounding to be close to the current system's update frequency, it shouldn't affect how stackable items are, and still allow for unloaded items to spoil.

VinterNacht commented 3 months ago

@Mrbysco One answer to this comes with stacking. When you stack the items, they average their spoilage rate and their creation time. This usually results in a net loss of freshness, so it's a trade-off of inventory space for freshness.