This is a long PR, in part because I meandered through several bugs.
In terms of tokens:
Tokens are now initialized properly (by virtue of reinstating idsAssigned event)
ID tokens were returned to something close to the 1.5.6 version (by virtue of reinstating the getAllIds functions for each type in the API)
Spritesheet coordinate tokens now all return 0 all the time for legacy compat
Spritesheet tokens return the name of the sprite sheet, derived from the type and the (fixed) item ID
In terms of the FixIdsJA function:
Applied the same fix as the previous PR, where it no longer obliterates Chinese/Korean/etc characters
Applied the same fix as the previous PR, where it leaves in converted to _ trailing spaces for fewer ID conflicts
Added new optional argument for the item type. If this argument is supplied, a qualified item ID using the mod it belongs to's uniqueID is appended to the beginning of the item. This allows for Lookup Anything to ID the content pack the item belongs to, among other nice features.
All of this relies on the DupObjects etc dictionaries, which are now public to facilitate this lookup
Literally everywhere .FixIdsJA is called was hand-checked to see if it can/should pass in a type
In terms of removed item migration:
New int to string dictionaries for every type of removed item
If the item exists in the game for other reasons (via ItemRegistry lookup), it's migrated
Removed items are still error items, but now they have human-readable names so users can figure out where they came from
Removed crops and fruit trees...do their best, fruit trees have human-readable names but are really broken, crops have indexOfHarvest and netSeedIndex set properly but are otherwise still definitely broken
From previous PR:
Shirts and pants are fixed. I built on this PR because otherwise even more stuff was broken in horrible ways, sorry.
Other stuff:
A few more places that should use fixed item IDs were fixed
Big craftable recipes were broken in the same way as object recipes, which I had missed in that PR, now fixed
Weapon data was defined in ContentInjector1 and WeaponData.cs contained incorrect/old information, so I moved the correct data building into WeaponData.cs
Same deal for crops as weapons (also true of fruit trees but see my other PR for a fix for that)
Duplicate checking is improved by rearranging of function calls, so no more spewing red errors, just the red warnings added by JA. Duplicate items probably could be tolerated by JA with some more clever messing around, but I didn't do that. Seems easier to tell people to name their items better?
I did test this in terms of loading it up on my giant test save, and things are working at least as well as they did before (in several cases, better). I did not test actually playing anything or saving through multiple days.
This is a long PR, in part because I meandered through several bugs.
In terms of tokens:
In terms of the FixIdsJA function:
In terms of removed item migration:
From previous PR:
Other stuff:
I did test this in terms of loading it up on my giant test save, and things are working at least as well as they did before (in several cases, better). I did not test actually playing anything or saving through multiple days.