About this mod
All machines (Vanilla and possibly modded) will now copy over input item's quality to output item's quality if possible.
- Requirements
- Permissions and credits
- Changelogs
This mod may counteract against some game design, but I thought fine ingredients should produce fine goods.
It basically overwrites all machines loaded at certain point in content pipeline, so I assume this mod has some extreme compatiblity with other mods.
Side effects:
1. Casks are practically obsolete.
2. Large Milk potential value = Regular Milk potential value (Large Milk produces gold quality cheese by default)
3. Items that cannot normally have quality (ex. Pickles and Jellies) get a quality.
I may provide an update with configurable patch to address 2&3.
This mod does not use Content Patcher and edits all machine data from "Data/Machines" with the priority of:
AssetEditPriority.Late + 2
Simple source code:
private void OnAssetRequested(object? sender, AssetRequestedEventArgs e)
{
if (e.NameWithoutLocale.IsEquivalentTo("Data/Machines"))
{
e.Edit(asset =>
{
var data = asset.AsDictionary<string, MachineData>().Data;
foreach ((string machineId, MachineData machineData) in data)
{
if (machineData.OutputRules != null)
{
foreach (var outputRules in machineData.OutputRules)
{
foreach (var outputItem in outputRules.OutputItem)
{
outputItem.CopyQuality = true;
}
}
}
}
}, AssetEditPriority.Late + 2);
}
}
That's it. Unless other mods are loaded/patched very late (priority 1003 and above), this will overwrite all machines if they have OutputRules.
I've checked with Butter Churn from Cornucopia - Artisan Machines, and Chest/Hoppers with Automate.
They are compatible.
Thank you.