The spoiled mod adds a spoilage mechanism to food over time.
This mod does the same thing but adds/fixes a mechanic for when you can merge items together.
Because spoiling food is treated as unique items, the spoiled mod allows for an option to generate recipes to merge items together as they cannot otherwise be stacked. however in doing so, it takes a simple average of the spoilage amount applying to both item stacks when calculating the spoilage amount of the resulting output.
In the original mod, combining a single apple with spoilage amount 0% with a stack of 63 apples with 99% spoilage would result in a stack of 64 apples with ~50% spoilage, half way between the spoilage of the original two inputs. This allows one to effectively nullify the spoilage mechanic by adding single fresh items to larger stacks iteratively or over time.
This fix adjusts the underlying logic to use a weighted average formula for spoilage when combining items. Thus in our previous example, the fresh apple will constitute 1/64th of the weight of the resulting output spoilage, and the 63 apples will constitute 63/64ths of the resulting spoilage.
This allows for the intuitive combining of items of different spoilage amounts, and reasonable benefits to doing so, without allowing for the possiblity of ignoring the spoilage mechanic entirely.

Join the discord to discuss feedback, issues, questions, suggestions.
Licence info:
MIT License Copyright (c) 2020 Mrbysco, ShyNieke Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` ### 2. CHANGES or README File (Recommended) Create `CHANGES.txt` or `README.txt`: ``` Spoiled - Weighted Average Fix Modified version of Spoiled by Mrbysco and ShyNieke CHANGES FROM ORIGINAL: - Fixed StackFoodRecipe to use weighted average for spoilage calculation - Prevents exploit where adding 1 fresh item to large spoiled stack resets spoilage ORIGINAL MOD: https://github.com/Mrbysco/Spoiled https://www.curseforge.com/minecraft/mc-mods/spoiled ORIGINAL AUTHORS: Mrbysco ShyNieke LICENSE: MIT License (see LICENSE file) This modified version is distributed under the same MIT License as the original.