# Prefix rework Prefixes are currently not very modder friendly. With 1.4.4 changes, we can fix this as we adapt the modded prefix code to the new 1.4.4 code. The current design emphasized small changes to ensure that our patch approach wouldn't cause vanilla changes to be mistakenly lost in updates, but now that the ItemIDs in each prefix category and the prefixes in those categories are stored separately, larger changes can be made without this fear. # Pain points 1. Custom Prefix Categories - Currently difficult to implement and verbose - Currently, you have to use `PrefixCategory.Custom` and `ItemLoader.ChoosePrefix` - Other mods can't add to your category - If the item's prefix category is not a weapon, then there's no way to know whether it is reforgeable via custom prefix, except calling `ItemLoader.ChoosePrefix` - `ModItem.MeleePrefix` , `WeaponPrefix`, etc... are all separate properties. 2. `ItemLoader.PrefixChance` has 2 use cases relating to 'natural prefixes' (`prefixWeWant == -1`): - Blocking an item from spawning with a natural prefix (or reducing the probability) - Forcing an item to spawn with a natural prefix (or increasing the probability) - This also overrides the vanilla 'bad prefix chance reduction', which probably isn't desirable - We should consider removing this hook, and making something more applicable to the target use-cases - The `int pre` parameter should be removed at the very least, as returning `true` has no effect when `pre != -1` and returning `false` when `pre != -1` will cause inconsistencies # New Approach 1. New ModPrefixCategory class - ModItem's Melee/Magic/Range/etc/Prefix methods replaced with GetPrefixCategory that returns a vanilla or modded category - ModPrefixCategory.ItemFitsCategory -> GlobalItem -> ModItem.GetPrefixCategory ModItem says I want to be this class, G 1. Single hook for Item prefix preference: (Mod/Global)EditPrefixPool - `ChoosePrefix`, `PrefixChance`, and `AllowPrefix` all essentially do the same thing. `ChoosePrefix` forces a specific prefix, `PrefixChance` # Discussion We would like some feedback on your experience with the current prefix system, as well as examples of use-cases for the prefix system that you've seen in mods you've worked on. We intend for these changes to happen in 1.4.4.