(Mod developers will likely want to read the details in the Pull Request, linked above.)
OnSpawn Hooks:
Added the OnSpawn hooks for items, NPCs and projectiles (called when X.NewX gets called). Aside from being usable for basic initialization of these entity types, the hooks provide access to IEntitySource arguments that have been inaccessible for quite too much time.
Modernization:
ModGore and ModDust have been tweaked to streamline the API;
NPCs and Projectiles now only use (improved) cloning for instantiation, CloneNewInstances properties have been removed.
Gore Sources:
IEntitySources are now used for instantiation of gores too. Previously there had been an attempt to make them be used for dusts, but collaborators found this to be way too tiresome to deal with.
Entity Source Contexts, Helpers, and Reorganizations
ItemSourceID and ProjectileSourceID static classes were removed in favor of new string? Context { get; } properties, which are available on every IEntitySource implementation.
The vanilla helper methods for Players, NPCs, Projectiles, Items have been redone to remove entity-type ties as much as possible.
Most of the renames go like .Get*Source_* -> .GetSource_*.
Changes to entity source classes and helpers can be seen in the full pull request, linked above.
• Stat Modifier now has Flat and Base fields
• Added attack speed and armor pen as 'stats' in the damage class system
• Hybrid items which benefit from combinations of stats from other classes are now incorporated into damage class (like whips)
• Crit chance and armor pen are copied onto projectiles on spawn, to fix crit-swapping
• Items can now have armor pen. Item armor pen is added to projectile armor-pen on projectile spawn.
• Attack speed is now an 'item use speed' modifier in the same vein as the other use speed hooks. It affects itemTime, animationTime and reuseDelay equally. This is a deviation from vanilla meleeSpeed which only affected animationTime, causing weird inconsistencies with weapons which had secondary effects under melee speed buffs. See the PR for more details on the vanilla differences. Some (modded) melee weapons could've been slightly buffed.
• ModTile.HasSmartInteract is now properly called again.
• Added new parameters to HasSmartInteract which are used for conditional checks like vanilla, showcased in ExampleToilet.
• Added new ModTile.ModifySmartInteractCoords hook which is showcased for ExampleBed, ExampleChair, and ExampleToilet, and should also be showcased whenever ExampleDresser gets ported.
• Added new ModTile.ModifySittingTargetInfo hook which is showcased for ExampleChair and ExampleToilet.
• Added new ModTile.ModifySleepingTargetInfo hook which is showcased for ExampleBed.
• Changed the NPC sitting code to account for modded chairs.
• Added NPCID.Sets.CannotSitOnFurniture.
• ExampleMod: Updated ExampleChair & ExampleBed examples based on 1.4 changes, added ExampleToilet (both almost the same functionality).
• ExampleMod: ExampleChair & ExampleBed now have a highlight texture.
• Added ModBuff and GlobalBuff hooks: PreDraw, PostDraw, RightClick
• Added summaries to some vanilla methods: Main.TryGetBuffTime, Main.TryRemovingBuff, Main.DrawBuffIcon
• ExampleMod: Added ExampleGlobalBuff.cs, AnimatedBuff.cs; Expanded ExampleDefenseBuff.cs, ExampleBuffPotion.cs, PartyZombie.cs
• Adds a CanFallThroughPlatforms ModNPC & GlobalNPC hook.
• ExampleCustomAISlime: Added CanFallThroughPlatforms examples, fixed localization for the NPC.
• Replaces TownNPCName hook with SetNPCNameList and adds global equivalent
• Adds SetTownNPCProfile hook
• Allows TML to add future Workshop Tags
• Adds a handful of preliminary tags to start with, and get feedback from
TML's personal naming conventions were slightly altered again to be closer to the common C# conventions from Microsoft, which are used in XNA and newer parts of Terraria. All non-private fields now use `PascalCase`, leaving `camelCase` only to local variables, method parameters, and private fields.
I went through many (mostly old) TML files and modernized as many as I could.
• Players will now see 'Alpha: This Mod is Old, Enable at own risk' in the mods menu for mods built during Alpha period of August 2021 to March 2022
• Players will now see 'Stable: this mod is old, enable at your own risk' for mods that haven't been updated in over a month and could be broken