• Translations are now fully in localization files (.hjson files). DisplayName and Tooltip, for example, can no longer be assigned in code.
• Localization files are automatically updated with entries for new content and managed by tModLoader. More organization options available.
• All ModTranslation usages are now replaced with LocalizedText
• All translation keys now follow a more predictable pattern: Mods.ModName.Category.ContentName.DataName
• Contributing translations, directly or through translation mods, streamlined.
Porting Notes: #preview-update-log in Discord
• Hookgen namespaces (IL. and On.) have been removed in favor of On_ and IL_ prepended to the type name.
• No longer will you get 3 different namespace suggestions when you use VS to import a Terraria type name.
• Want On Item hooks? Just use On_Item it's in the same namespace as Item!
Porting Notes: #preview-update-log in Discord
• NPC shops are now declarative, meaning they get registered, and items can be added to them with conditions, similarly to NPC drops (loot) and recipes
• Adding items to shops, or hiding items from shops is now as easy as adding or disabling recipes
• Info mods can traverse the NPCShopDatabase to show how to obtain an item. All the conditions for items appearing in shops have been localized.
• Registering multiple shops per NPC is perfectly fine, and selecting the shop to be opened when chatting can now be done via the ref string shop parameter in OnChatButtonClicked
Porting Notes: #preview-update-log in Discord
• Adds ModPlayer.ModifyMaxStats with StatModifier arguments for permanent adjustments to max health/mana.
• Adds Player.ConsumedLifeCrystals, ConsumedLifeFruit and ConsumedManaCrystals properties.
• Add helper methods Player.UseHealthMaxIncreasingItem and Player.UseManaMaxIncreasingItem for the visual effects.
• Adds ModResourceDisplaySet allowing for custom life/mana draw styles (similar to boss bar styles) that can be selected in settings.
• Adds ModResourceOverlay to allow for drawing custom hearts/mana/effects over the vanilla (or modded) life/mana UI elements.
Porting Notes: #preview-update-log in Discord
• Adds the ability to add new hairstyles, with unlock conditions.
• Updates to MonoMod involve the removal of old APIs, and better performance and stability moving forward.
• NativeDetour and Detour are gone, there was little need for modders to use these anyway.
Porting Notes: #preview-update-log in Discord
Player and NPC hit hooks (OnHit, ModifyHit, OnHitBy, etc) have been simplified with common architecture, and had many new features added.
Porting Notes: #preview-update-log in Discord
• Adds ModItem/GlobalItem.OnStack and SplitStack to enable modded data such as experience counters, durability, etc to work with stackable items.
• Crafting now creates the recipe item(s) first, and then combines them using OnStack. This means that in OnCreate,
RecipeCreationContext.DestinationStack has been added so you can make sure that the crafted result is stackable with the mouse item (if any)
Porting Notes: #preview-update-log in Discord
• ModConfig can now be localized by default.
• Localization for ModConfig entries are now done fully in .hjson files.
• .hjson files are automatically populated with entries.
• New LabelArgs and TooltipArgs attributes allow for cleaner code and better code/localization reuse.
• [Label] and [Tooltip] obsolete, [Header] changed. See porting notes.
Porting Notes: #preview-update-log in Discord
• All entity sources have been reviewed. Most are unchanged, but some have been removed, some added, or split.
• Many sources now extend EntitySource_Parent which is the most useful source. If in doubt, use GetSource_FromThis() when spawning a projectile.
• CritChance and ArmorPenetration now transfer from parent to child projectiles, and from players to player spawned projectiles.
• Projectile.ContinuouslyUpdateDamage is now ContinuouslyUpdateDamageStats and also updates CritChance and ArmorPenetration (no, minions still cannot crit, even though they have CritChance)
Porting Notes: #preview-update-log in Discord
• Modded keybinds are now localizable
• The name passed into KeybindLoader.RegisterKeybind is used in the key: "Mods.{ModName}.Keybind.{KeybindName}"
Porting Notes: #preview-update-log in Discord
• Added new Item.NewItem overloads that take an Item instance and clones it, allowing spawning a clone of an item.
• Fixes several cases where modded data was lost or broken (mediumcore death, items dropping from Tile Entities)
• Player.QuickSpawnItem (and similar) overloads with the Item parameter now use the item cloning by default. Player.QuickSpawnClonedItem is now marked as obsolete.
Porting Notes: #preview-update-log in Discord
• Adds item.Consummable as a check in Quick Heal and Quick Mana
• Is a simpler solution then overriding ConsumeItem(
Porting Notes: #preview-update-log in Discord
• Adds ModSystem.ClearWorld which runs on world clear. The new best place to clear/initialize world related data structures.
Porting Notes: #preview-update-log in Discord
• Adds some helper methods and an exception for easier IL editing and error handling.
• Adds WorldGen.ModifyPass and WorldGen.DetourPass to allow easily IL hooking legacy world gen passes
• It is recommended for modders to wrap their IL hooks in a try-catch, and call either MonoModHooks.DumpIL or throw new ILPatchFailureException so that a user can provide the IL log file for diagnosis when hooks fail.
Porting Notes: #preview-update-log in Discord
• Terraria.Recipe.Condition has been moved to Terraria.Condition and can now be applied to more things. Recipes, item variants, drops and soon shops
• Added SimpleItemDropRuleCondition class to help make drop conditions more easily.
Porting Notes: #preview-update-log in Discord
• Tiles and walls now automatically drop the items that place it. This process supports tiles with multiple styles.
• Block Swap feature now supports modded torches, chests, and drawers.
• Other miscellaneous fixes.
Porting Notes: #preview-update-log in Discord
• All items will now default to needing 1 item to research.
• The previous value of 0 left items unresearchable since many modders don't bother to implement journey mode features
• Modders can clean up their code. ModItems with Item.ResearchUnlockCount = 1; lines can be deleted.
Porting Notes: #preview-update-log in Discord
• New hooks, mirroring CanHitNPC but called on the victim's ModNPC and GlobalNPC
• Player.BuyItem split into BuyItem, CanAfford, and PayCurrency methods
• Player.CanBuyItem removed
• CustomCurrencyManager.BuyItem split in the same manner.
• Mod/GlobalItem.PreReforge is now split into PreReforge and CanReforge. PreReforge no longer returns bool, CanReforge handles that purpose.
Porting Notes: #preview-update-log in Discord
• Renames Player.rocketDamage to Player.specialistDamage, in line with 1.4.4 changes to Shroomite Helmet that changed "bonus rocket damage" to "bonus specialist ranged damage".
• Renames AmmoID.Sets.IsRocket to AmmoID.Sets.IsSpecialist and adds ammo entries matching Terraria for the same reason.
• Adds ItemID.Sets.IsRangedSpecialistWeapon to cover specialist weapons that don't use ammo.
Porting Notes: #preview-update-log in Discord
• ModPrefix.GetTooltipLines added to allow adding tooltips directly from ModPrefix class. Better code cohesion.
Porting Notes: #preview-update-log in Discord
• Reworks automatic tile drops introduced in https://github.com/tModLoader/tModLoader/pull/3210
• ModBlockType.ItemDrop removed.
• TileLoader.GetItemDropFromTypeAndStyle no longer falls back to tile style 0. A special fallback will be used if the style is not found.
• ModTile.RegisterItemDrop added. Allows manually registering an item drop for a tile style, or as a fallback item. Used to provide drops for styles that don't have a corresponding item that places it.
• ModWall.RegisterItemDrop added. Allows manual registration of wall drop, useful for unsafe walls that drop safe walls.
Porting Notes: #preview-update-log in Discord
• IModType is no longer ILoadable, ModType is unchanged
• As a reminder, IModType exists only to support classes that can't extend from ModType. In tML the only instance of this is ModTileEntity which much extend from TileEntity, there is little reason for modders to extend from it instead of ModType.
Porting Notes: #preview-update-log in Discord
• TownNPCMood localization entries will automatically populate .hjson for town npc. Only used keys will be populated.
• TownNPCDialogueName localization entries will automatically populate .hjson for biomes.
• NPCID.Sets.NoTownNPCHappiness added for town npc that don't use happiness.
Porting Notes: #preview-update-log in Discord
• Allows modders to affect NPC gravity and maxFallSpeed without interfering with other mods by multiplying NPC.GravityMultiplier and NPC.MaxFallSpeedMultiplier
• Adds GravityIgnoresType, GravityIgnoresLiquid and GravityIgnoresSpace properties to NPC to disable the respective vanilla gravity calculations.
Porting Notes: #preview-update-log in Discord
Item.Clone can become very performance expensive with many mods. Only type, stack and prefix are required to tell if an item has changed in the inventory and needs to be re-synced.
This PR replaces usages of Item.Clone in Player.clientClone with Item.CopyNetStateTo
Additionally, a single Player (and ModPlayer) instance is reused for all clientClone/CopyClientStateTo calls, acting as a 'storage copy' rather than making a new one each frame.
Please note that tModPorter is not smart enough to identify Item.Clone usages in ModPlayer.CopyClientStateTo calls automatically. You will need to replace these yourself or an exception will be thrown at runtime.
Porting Notes: #preview-update-log in Discord
• More performance, more modularity. No need to fear having hundreds of globals per mod. The new system should do better at optimizing performance than a modder can with 'uber globals' because it will skip even iterating past a global which doesn't apply to the target entity type.
• AppliesToEntity is not called during the game anymore! Instead, whether a global applies to an Item/Projectile/NPC type is computed and cached at the end of PostSetupContent
• This is a minimally breaking change, but reading the PR description is strongly recommended, especially for advanced modders.
Porting Notes: #preview-update-log in Discord
• Biome Torch/Campfire (Torch Gods Favor) support has been added. ModBiome can now dictate the appropriate item to auto swap.
• Various torch issues have been fixed: Smart cursor, underwater placement, duplication menu category
• Block Swap feature now supports modded Campfire tiles.
• ExampleWaterTorch added. ExampleCampfire added.
Porting Notes: #preview-update-log in Discord
• UICommon.WithFadedMouseOver now supports border color toggling.
Porting Notes: #preview-update-log in Discord
• If you are using ModWaterStyle, make sure you have a _Slope.png file. If you didn't, your mod won't load and will need to be updated.Rijam - More Conditions
• The Slope texture was added in 1.4.4 Terraria and helps draw water correctly around sloped tiles. See https://github.com/tModLoader/tModLoader/blob/1.4.4/ExampleMod/Content/Biomes/ExampleWaterStyle_Slope.png for an example. You can also look at the Images/LiquidSlope_# files from vanilla.