Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Food Spoilage Feature #51

Open
gatoborrachon opened this issue Oct 8, 2021 · 0 comments
Open

[Suggestion] Food Spoilage Feature #51

gatoborrachon opened this issue Oct 8, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@gatoborrachon
Copy link

gatoborrachon commented Oct 8, 2021

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

@gatoborrachon gatoborrachon added the enhancement New feature or request label Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant