tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.ModLoader.Default.UnloadedSystem Class Reference

Inherits Terraria.ModLoader.ModSystem.

Public Member Functions

override void LoadWorldData (TagCompound tag)
 Allows you to load custom data you have saved for this system in the currently loading world. More...
 
override void OnWorldLoad ()
 Called whenever a world is loaded. This can be used to initialize data structures, etc. More...
 
override TagCompound SaveWorldData ()
 Allows you to save custom data for this system in the current world. Useful for things like saving world specific flags. For example, if your mod adds a boss and you want certain NPC to only spawn once it has been defeated, this is where you would store the information that that boss has been defeated in this world. Returns null by default. More...
 
- Public Member Functions inherited from Terraria.ModLoader.ModSystem
virtual bool HijackGetData (ref byte messageType, ref BinaryReader reader, int playerNumber)
 Allows you to modify net message / packet information that is received before the game can act on it. More...
 
virtual bool HijackSendData (int whoAmI, int msgType, int remoteClient, int ignoreClient, NetworkText text, int number, float number2, float number3, float number4, int number5, int number6, int number7)
 Hijacks the send data method. Only use if you absolutely know what you are doing. If any hooks return true, the message is not sent. More...
 
virtual void ModifyHardmodeTasks (List< GenPass > list)
 Similar to ModifyWorldGenTasks, but occurs in-game when Hardmode starts. Can be used to modify which tasks should be done and/or add custom tasks. By default the list will only contain 4 items, the vanilla hardmode tasks called "Hardmode Good", "Hardmode Evil", "Hardmode Walls", and "Hardmode Announcment" More...
 
virtual void ModifyInterfaceLayers (List< GameInterfaceLayer > layers)
 Allows you to modify the elements of the in-game interface that get drawn. GameInterfaceLayer can be found in the Terraria.UI namespace. Check https://github.com/tModLoader/tModLoader/wiki/Vanilla-Interface-layers-values for vanilla interface layer names More...
 
virtual void ModifyLightingBrightness (ref float scale)
 Allows you to modify overall brightness of lights. Can be used to create effects similiar to what night vision and darkness (de)buffs give you. Values too high or too low might result in glitches. For night vision effect use scale 1.03 More...
 
virtual void ModifyScreenPosition ()
 Use this hook to modify Main.screenPosition after weapon zoom and camera lerp have taken place. More...
 
virtual void ModifySunLightColor (ref Color tileColor, ref Color backgroundColor)
 Allows you to modify color of light the sun emits. More...
 
virtual void ModifyTimeRate (ref double timeRate, ref double tileUpdateRate, ref double eventUpdateRate)
 Called after all other time calculations. Can be used to modify the speed at which time should progress per tick in seconds, along with the rate at which the tiles in the world and the events in the world should update with it. All fields are measured in in-game minutes per real-life second (min/sec). You may want to consider Main.fastForwardTime and CreativePowerManager.Instance.GetPower<CreativePowers.FreezeTime>().Enabled here. More...
 
virtual void ModifyTransformMatrix (ref SpriteViewMatrix Transform)
 Allows you to set the transformation of the screen that is drawn. (Translations, rotations, scales, etc.) More...
 
virtual void ModifyWorldGenTasks (List< GenPass > tasks, ref float totalWeight)
 A more advanced option to PostWorldGen, this method allows you modify the list of Generation Passes before a new world begins to be generated. For example, removing the "Planting Trees" pass will cause a world to generate without trees. Placing a new Generation Pass before the "Dungeon" pass will prevent the the mod's pass from cutting into the dungeon. More...
 
virtual void NetReceive (BinaryReader reader)
 Allows you to do things with custom data that is received between clients and server. More...
 
virtual void NetSend (BinaryWriter writer)
 Allows you to send custom data between clients and server. This is useful for syncing information such as bosses that have been defeated. More...
 
virtual void OnModLoad ()
 This hook is called right after Mod.Load(), which is guaranteed to be called after all content has been autoloaded. More...
 
virtual void OnWorldUnload ()
 Called whenever a world is unloaded. Use this to deinitialize world-related data structures, etc. More...
 
virtual void PostDrawFullscreenMap (ref string mouseText)
 Called while the fullscreen map is active. Allows custom drawing to the map. More...
 
virtual void PostDrawInterface (SpriteBatch spriteBatch)
 Called after interface is drawn but right before mouse and mouse hover text is drawn. Allows for drawing interface. More...
 
virtual void PostDrawTiles ()
 Called after drawing Tiles. Can be used for drawing a tile overlay akin to wires. Note that spritebatch should be begun and ended within this method. More...
 
virtual void PostSetupContent ()
 Allows you to load things in your system after the mod's content has been setup (arrays have been resized to fit the content, etc). More...
 
virtual void PostUpdateDusts ()
 Called after Dusts get updated. More...
 
virtual void PostUpdateEverything ()
 Called after the Network got updated, this is the last hook that happens in an update. More...
 
virtual void PostUpdateGores ()
 Called after Gores get updated. More...
 
virtual void PostUpdateInput ()
 Called after the input keys are polled. Allows for modifying things like scroll wheel if your custom drawing should capture that. More...
 
virtual void PostUpdateInvasions ()
 Called after Invasions get updated. This hook is not called for multiplayer clients. More...
 
virtual void PostUpdateItems ()
 Called after Items get updated. More...
 
virtual void PostUpdateNPCs ()
 Called after NPCs get updated. More...
 
virtual void PostUpdatePlayers ()
 Called after Players get updated. More...
 
virtual void PostUpdateProjectiles ()
 Called after Projectiles get updated. More...
 
virtual void PostUpdateTime ()
 Called after Time gets updated. More...
 
virtual void PostUpdateWorld ()
 Use this method to have things happen in the world. In vanilla Terraria, a good example of code suitable for this hook is how Falling Stars fall to the ground during the night. This hook is not called for multiplayer clients. More...
 
virtual void PostWorldGen ()
 Use this method to place tiles in the world after world generation is complete. More...
 
virtual void PreSaveAndQuit ()
 Called in SP or Client when the Save and Quit button is pressed. One use for this hook is clearing out custom UI slots to return items to the player.
More...
 
virtual void PreUpdateDusts ()
 Called before Dusts get updated. More...
 
virtual void PreUpdateEntities ()
 Use this if you want to do something before anything in the World gets updated. Called after UI updates, but before anything in the World (Players, NPCs, Projectiles, Tiles) gets updated. More...
 
virtual void PreUpdateGores ()
 Called before Gores get updated. More...
 
virtual void PreUpdateInvasions ()
 Called before Invasions get updated. This hook is not called for multiplayer clients. More...
 
virtual void PreUpdateItems ()
 Called before Items get updated. More...
 
virtual void PreUpdateNPCs ()
 Called before NPCs get updated. More...
 
virtual void PreUpdatePlayers ()
 Called before Players get updated. More...
 
virtual void PreUpdateProjectiles ()
 Called before Projectiles get updated. More...
 
virtual void PreUpdateTime ()
 Called before Time gets updated. More...
 
virtual void PreUpdateWorld ()
 Use this method to have things happen in the world. In vanilla Terraria, a good example of code suitable for this hook is how Falling Stars fall to the ground during the night. This hook is not called for multiplayer clients. More...
 
virtual void PreWorldGen ()
 Allows a mod to run code before a world is generated. More...
 
virtual void ResetNearbyTileEffects ()
 Use this to reset any fields you set in any of your ModTile.NearbyEffects hooks back to their default values. More...
 
sealed override void SetStaticDefaults ()
 Allows you to modify the properties after initial loading has completed. More...
 
sealed override void SetupContent ()
 If you make a new ModType, seal this override, and call SetStaticDefaults in it. More...
 
virtual void TileCountsAvailable (ReadOnlySpan< int > tileCounts)
 Allows you to store information about how many of each tile is nearby the player. This is useful for counting how many tiles of a certain custom biome there are.
The tileCounts parameter is a read-only span (treat this as an array) that stores the tile count indexed by tile type. More...
 
virtual void UpdateUI (GameTime gameTime)
 Ran every update and suitable for calling Update for UserInterface classes More...
 
- Public Member Functions inherited from Terraria.ModLoader.ModType
virtual bool IsLoadingEnabled (Mod mod)
 Allows you to stop Mod.AddContent from actually adding this content. Useful for items that can be disabled by a config. More...
 
virtual void Load ()
 Allows you to perform one-time loading tasks. Beware that mod content has not finished loading here, things like ModContent lookup tables or ID Sets are not fully populated. More...
 
virtual void Unload ()
 Allows you to safely unload things you added in Load. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Terraria.ModLoader.ModSystem
override void Register ()
 If you make a new ModType, seal this override. More...
 
- Properties inherited from Terraria.ModLoader.ModType
string FullName [get]
 The internal name of this, including the mod it is from. More...
 
Mod Mod [get, set]
 The mod this belongs to. More...
 
virtual string Name [get]
 The internal name of this. More...
 
- Properties inherited from Terraria.ModLoader.IModType
string FullName [get]
 => $"{Mod.Name}/{Name}" More...
 
Mod Mod [get]
 The mod this belongs to. More...
 
string Name [get]
 The internal name of this instance. More...
 

Member Function Documentation

◆ LoadWorldData()

override void Terraria.ModLoader.Default.UnloadedSystem.LoadWorldData ( TagCompound  tag)
virtual

Allows you to load custom data you have saved for this system in the currently loading world.

Reimplemented from Terraria.ModLoader.ModSystem.

◆ OnWorldLoad()

override void Terraria.ModLoader.Default.UnloadedSystem.OnWorldLoad ( )
virtual

Called whenever a world is loaded. This can be used to initialize data structures, etc.

Reimplemented from Terraria.ModLoader.ModSystem.

◆ SaveWorldData()

override TagCompound Terraria.ModLoader.Default.UnloadedSystem.SaveWorldData ( )
virtual

Allows you to save custom data for this system in the current world. Useful for things like saving world specific flags. For example, if your mod adds a boss and you want certain NPC to only spawn once it has been defeated, this is where you would store the information that that boss has been defeated in this world. Returns null by default.

Reimplemented from Terraria.ModLoader.ModSystem.