Survival Inc.

Survival Inc.

7.5k Downloads

[Suggestion] Food Spoilage Feature

gatoborrachon opened this issue ยท 0 comments

commented

Please describe your requested feature
This was extracted from my comment in #48, where i said that adding a Food Spoilage feature to Survival Inc. could be in the scope of the mod, using a combination of the TFC and FoodFunk's Implementations (the last one is not exactly).

Describe your proposed implementation details
+If I Recall Correctly, TFC adds this Rotten feature with NBT and Capabilities to items that can be eated, but once they decay to 100% rotten they can't be differentiated by most mods (between Rotten and Fresh food due to using an NBT Tag), so their implementation is mostly exclusive to be used with its machines (that can detect that NBT Tag)

+And we have FoodFunk, which verifies every tick every container to see if the ItemFood is already rotten so it replaced it with a "Rotten Food" item, which can be differentiated pretty easily by the other mods since it is another item, but the way that it checks for rotten items costs A LOT of performance, making it infeasible

-But then i remembered about a mod called InstantUnify, which replaces an oreDicted item from many mods into the one you want from only 1 mod (For example, 3 kinds of copper from mods like Immersive Engineering, IC2 and Thermal Expansion become automatically into 3 ingots of IC2 copper), but most important, this replacement can be triggered by many events (when an EntityItem is spawned, when it is harvested, when it is droped by the dead of another entity and every second), but the most interesting is "Unify items in player's inventory when GUI is opened/closed.", so with all this explained, this came to my mind:


+IMPLEMENTATION: Do something similar to what TFC does to handle rottening of food, but once an item is at 100% rotten, it will be replaced into a "Rotten Food" item in "player's inventory when GUI is opened/closed" (and in any inventory that is being accessed by the player, like a chest)

Additional Notes
+Well, i always had in mind this idea, i think that it is almost the perfect way to handle this "Food Spoilage Feature", but as always i would like to hear what do you think, is it a good feature? does it fits in the mod's scope? you know how how to implement it?

+i also need to clarify that i haven't tested the performance of the TFC's implementation that much, but i trust that there should not be a massive lag like in FoodFunk because i haven't heard about this issue in TFC.

+Another thing to add to this suggestion: There's something like a "blind spot" where you can avoid the trigger of "Replace items in player's inventory when GUI is opened/closed" if you don't interact with the Inventory at all (using for example, pipes to move items), but i think that this is a minimal issue since at the end, if you want to use food in the conventional way, you will require to open a GUI with that rotten food, so it is replaced with a "Rotten Food Item" automatically as soon as you see it
-Althought, if you know a way or event that is triggered everytime that an item is extracted from an Inventory, it could help to fix this minimal issue