Trinket Colorizer and Anvil
Machines are provided for the purpose of rerolling/upgrading trinkets.
Trinket Colorizer 
The trinket colorizer is a big craftable machine that can be purchased from the Blacksmith for 50 Gold Bars once the Anvil recipe is obtained. Trinkets must have at least 2 variants and CanBeReforged
set to true in order to use the colorizer.
Consumes 15 Omni Geode to reroll the variant on a TrinketTinker trinket, no effect on vanilla trinkets.
The colorizer will never roll the same variant twice in a row. Anvils have similar rule applied to them for TrinketTinker trinkets.
Implementation wise, the colorizer is a standard big craftabe machine with qualified ID (BC)mushymato.TrinketTinker_TrinketColorizer
and a complex output machine rule. Mods are free to add more ways to obtain this machine and prepend the colorizer with special upgrade rules for their trinkets.
Anvil
Trinket tinker does not use vanilla Anvil's level reroll logic and instead uses a custom output method. Trinkets must have at least 2 levels and CanBeReforged
set to true in order to use the anvil. The cost is 3 iridium bars, just like vanilla.
Adding Custom Machine Rules for Upgrades
This example assumes you already know how to add a new machine rule.
To add your own machine rule for upgrading trinkets add a new OutputRules
entry like so:
"{{ModId}}_YourTrinket_Rule": {
"Id": "{{ModId}}_YourTrinket_Rule",
"Triggers": [
{
"Id": "{{ModId}}_YourTrinket_Rule_ItemPlacedInMachine",
"Trigger": "ItemPlacedInMachine",
// Require a specific trinket
"RequiredItemId": "(TR){{ModId}}_YourTrinket",
"RequiredCount": 1,
"Condition": "mushymato.TrinketTinker_IS_TINKER Input ? <=M"
}
],
"OutputItem": [
{
"Id": "{{ModId}}_YourTrinket_Rule_Output",
// Use output method
"OutputMethod": "TrinketTinker.Extras.TrinketColorizer, TrinketTinker:OutputTrinketColorizer",
// The Anvil OutputMethod is "TrinketTinker.Extras.TrinketColorizer, TrinketTinker:OutputTinkerAnvil"
"CustomData": {
// Instead of rerolling, add 1 to variant
"mushymato.TrinketTinker/Variant+": 1,
// Same as above, for level
"mushymato.TrinketTinker/Level+": 1,
}
}
]
}
If you are adding this to the trinket colorizer or the anvil, you will need to move your rule above the default rule provided by trinket tinker.
"MoveEntries": [
{
"Id": "{{ModId}}_StatiColorMask_Output",
// Same ID for both Anvil and Trinket Colorizer
"BeforeID": "mushymato.TrinketTinker_Default"
}
]
Aside from using OutputMethod, you may also use item query mushymato.TrinketTinker_CREATE_TRINKET
, it just won't be able to increment the level.