tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
Mod is an abstract class that you will override. It serves as a central place from which the mod's contents are stored. It provides methods for you to use or override. More...
Public Member Functions | |
void | AddBackgroundTexture (string texture) |
Adds a texture to the list of background textures and assigns it a background texture slot. More... | |
void | AddBossHeadTexture (string texture, int npcType=-1) |
Assigns a head texture that can be used by NPCs on the map. More... | |
void | AddBuff (string name, ModBuff buff, string texture) |
Adds a type of buff to the game with the specified internal name and texture. More... | |
void | AddCommand (string name, ModCommand mc) |
Manually add a Command during Load More... | |
void | AddConfig (string name, ModConfig mc) |
void | AddDust (string name, ModDust dust, string texture="") |
Adds a type of dust to your mod with the specified name. Create an instance of ModDust normally, preferably through the constructor of an overriding class. Leave the texture as an empty string to use the vanilla dust sprite sheet. More... | |
int | AddEquipTexture (EquipTexture equipTexture, ModItem item, EquipType type, string name, string texture, string armTexture="", string femaleTexture="") |
Adds an equipment texture of the specified type, internal name, and associated item to your mod. This method is different from the other AddEquipTexture in that you can specify the class of the equipment texture, thus allowing you to override EquipmentTexture's hooks. All other parameters are the same as the other AddEquipTexture. More... | |
int | AddEquipTexture (ModItem item, EquipType type, string name, string texture, string armTexture="", string femaleTexture="") |
Adds an equipment texture of the specified type, internal name, and associated item to your mod. (The item parameter may be null if you don't want to associate an item with the texture.) You can then get the ID for your texture by calling EquipLoader.GetEquipTexture, and using the EquipTexture's Slot property. If the EquipType is EquipType.Body, make sure that you also provide an armTexture and a femaleTexture. Returns the ID / slot that is assigned to the equipment texture. More... | |
void | AddGlobalBgStyle (string name, GlobalBgStyle globalBgStyle) |
Adds the given global background style with the given name to this mod. More... | |
void | AddGlobalBuff (string name, GlobalBuff globalBuff) |
Adds the given GlobalBuff instance to this mod using the provided name. More... | |
void | AddGlobalItem (string name, GlobalItem globalItem) |
Adds the given GlobalItem instance to this mod with the provided name. More... | |
void | AddGlobalNPC (string name, GlobalNPC globalNPC) |
Adds the given GlobalNPC instance to this mod with the provided name. More... | |
void | AddGlobalProjectile (string name, GlobalProjectile globalProjectile) |
Adds the given GlobalProjectile instance to this mod with the provided name. More... | |
void | AddGlobalRecipe (string name, GlobalRecipe globalRecipe) |
Manually add a Global Recipe during Load More... | |
void | AddGlobalTile (string name, GlobalTile globalTile) |
Adds the given GlobalTile instance to this mod with the provided name. More... | |
void | AddGlobalWall (string name, GlobalWall globalWall) |
Adds the given GlobalWall instance to this mod with the provided name. More... | |
void | AddGore (string texture, ModGore modGore=null) |
Adds the given texture to the game as a custom gore, with the given custom gore behavior. If no custom gore behavior is provided, the custom gore will have the default vanilla behavior. More... | |
void | AddItem (string name, ModItem item) |
Adds a type of item to your mod with the specified internal name. This method should be called in Load. You can obtain an instance of ModItem by overriding it then creating an instance of the subclass. More... | |
void | AddModWorld (string name, ModWorld modWorld) |
Adds a ModWorld to this mod with the given name. More... | |
void | AddMount (string name, ModMountData mount, string texture, IDictionary< MountTextureType, string > extraTextures=null) |
Adds the given mount to the game with the given name and texture. The extraTextures dictionary should optionally map types of mount textures to the texture paths you want to include. More... | |
void | AddMusicBox (int musicSlot, int itemType, int tileType, int tileFrameY=0) |
Allows you to tie a music ID, and item ID, and a tile ID together to form a music box. When music with the given ID is playing, equipped music boxes have a chance to change their ID to the given item type. When an item with the given item type is equipped, it will play the music that has musicSlot as its ID. When a tile with the given type and Y-frame is nearby, if its X-frame is >= 36, it will play the music that has musicSlot as its ID. More... | |
void | AddNPC (string name, ModNPC npc) |
Adds a type of NPC to the game with the specified name and texture. Also allows you to give the NPC alternate textures. More... | |
void | AddNPCHeadTexture (int npcType, string texture) |
Assigns a head texture to the given town NPC type. More... | |
void | AddPlayer (string name, ModPlayer player) |
Adds a type of ModPlayer to this mod. All ModPlayer types will be newly created and attached to each player that is loaded. More... | |
void | AddPrefix (string name, ModPrefix prefix) |
Adds a prefix to your mod with the specified internal name. This method should be called in Load. You can obtain an instance of ModPrefix by overriding it then creating an instance of the subclass. More... | |
void | AddProjectile (string name, ModProjectile projectile) |
Adds a type of projectile to the game with the specified name. More... | |
virtual void | AddRecipeGroups () |
Override this method to add recipe groups to this mod. You must add recipe groups by calling the RecipeGroup.RegisterGroup method here. A recipe group is a set of items that can be used interchangeably in the same recipe. More... | |
virtual void | AddRecipes () |
Override this method to add recipes to the game. It is recommended that you do so through instances of ModRecipe, since it provides methods that simplify recipe creation. More... | |
void | AddSound (SoundType type, string soundPath, ModSound modSound=null) |
Adds the given sound file to the game as the given type of sound and with the given custom sound playing. If no ModSound instance is provided, the custom sound will play in a similar manner as the default vanilla ones. More... | |
void | AddSurfaceBgStyle (string name, ModSurfaceBgStyle surfaceBgStyle) |
Adds the given surface background style with the given name to this mod. More... | |
void | AddTexture (string name, Texture2D texture) |
Shorthand for calling ModLoader.AddTexture(this.FileName(name), texture). More... | |
void | AddTile (string name, ModTile tile, string texture) |
Adds a type of tile to the game with the specified name and texture. More... | |
void | AddTileEntity (string name, ModTileEntity entity) |
Manually add a tile entity during Load. More... | |
void | AddTranslation (ModTranslation translation) |
Adds a ModTranslation to the game so that you can use Language.GetText to get a LocalizedText. More... | |
void | AddUgBgStyle (string name, ModUgBgStyle ugBgStyle) |
Adds the given underground background style with the given name to this mod. More... | |
void | AddWall (string name, ModWall wall, string texture) |
Adds a type of wall to the game with the specified name and texture. More... | |
void | AddWaterfallStyle (string name, ModWaterfallStyle waterfallStyle, string texture) |
Adds the given waterfall style to the game with the given name and texture path. More... | |
void | AddWaterStyle (string name, ModWaterStyle waterStyle, string texture, string blockTexture) |
Adds the given water style to the game with the given name, texture path, and block texture path. More... | |
int | BuffType (string name) |
Gets the type of the ModBuff of this mod corresponding to the given name. Returns 0 if no ModBuff with the given name is found. More... | |
int | BuffType< T > () |
Same as the other BuffType, but assumes that the class name and internal name are the same. More... | |
virtual object | Call (params object[] args) |
Used for weak inter-mod communication. This allows you to interact with other mods without having to reference their types or namespaces, provided that they have implemented this method. More... | |
virtual void | Close () |
Close is called before Unload, and may be called at any time when mod unloading is imminent (such as when downloading an update, or recompiling) Use this to release any additional file handles, or stop streaming music. Make sure to call base.Close() at the end May be called multiple times before Unload More... | |
ModTranslation | CreateTranslation (string key) |
Creates a ModTranslation object that you can use in AddTranslation. More... | |
int | DustType (string name) |
Gets the type of the ModDust of this mod with the given name. Returns 0 if no ModDust with the given name is found. More... | |
int | DustType< T > () |
Same as the other DustType, but assumes that the class name and internal name are the same. More... | |
bool | EffectExists (string name) |
Used to check if a custom Effect exists More... | |
bool | FileExists (string name) |
Shorthand for calling ModLoader.FileExists(this.FileName(name)). Note that file extensions are used here. More... | |
bool | FontExists (string name) |
Used to check if a custom SpriteFont exists More... | |
sbyte | GetAccessorySlot (string name, EquipType type) |
Same as GetEquipSlot, except returns the number as an sbyte (signed byte) for your convenience. More... | |
int | GetBackgroundSlot (string name) |
Gets the texture slot corresponding to the specified texture name. Shorthand for calling BackgroundTextureLoader.GetBackgroundSlot(this.Name + '/' + name). More... | |
ModBuff | GetBuff (string name) |
Gets the ModBuff of this mod corresponding to the given name. Returns null if no ModBuff with the given name is found. More... | |
T | GetBuff< T > () |
ModConfig | GetConfig (string name) |
T | GetConfig< T > () |
ModDust | GetDust (string name) |
Gets the ModDust of this mod corresponding to the given name. Returns null if no ModDust with the given name is found. More... | |
T | GetDust< T > () |
Same as the other GetDust, but assumes that the class name and internal name are the same. More... | |
Effect | GetEffect (string name) |
Gets an Effect loaded from the specified path. More... | |
int | GetEquipSlot (string name, EquipType type) |
Gets the slot/ID of the equipment texture corresponding to the given name. Returns -1 if no EquipTexture with the given name is found. More... | |
EquipTexture | GetEquipTexture (string name, EquipType type) |
Gets the EquipTexture instance corresponding to the name and EquipType. Returns null if no EquipTexture with the given name and EquipType is found. More... | |
byte[] | GetFileBytes (string name) |
Retrieve contents of files within the tmod file More... | |
Stream | GetFileStream (string name, bool newFileStream=false) |
Retrieve contents of files within the tmod file More... | |
DynamicSpriteFont | GetFont (string name) |
Gets a SpriteFont loaded from the specified path. More... | |
GlobalBgStyle | GetGlobalBgStyle (string name) |
Returns the global background style corresponding to the given name. More... | |
T | GetGlobalBgStyle< T > () |
GlobalBuff | GetGlobalBuff (string name) |
Gets the GlobalBuff with the given name from this mod. More... | |
T | GetGlobalBuff< T > () |
GlobalItem | GetGlobalItem (string name) |
Gets the GlobalItem instance with the given name from this mod. More... | |
T | GetGlobalItem< T > () |
Same as the other GetGlobalItem, but assumes that the class name and internal name are the same. More... | |
GlobalNPC | GetGlobalNPC (string name) |
Gets the GlobalNPC instance with the given name from this mod. More... | |
T | GetGlobalNPC< T > () |
GlobalProjectile | GetGlobalProjectile (string name) |
Gets the GlobalProjectile instance with the given name from this mod. More... | |
T | GetGlobalProjectile< T > () |
GlobalRecipe | GetGlobalRecipe (string name) |
Gets the global recipe corresponding to the specified name. More... | |
T | GetGlobalRecipe< T > () |
GlobalTile | GetGlobalTile (string name) |
Gets the GlobalTile instance with the given name from this mod. More... | |
T | GetGlobalTile< T > () |
Same as the other GetGlobalTile, but assumes that the class name and internal name are the same. More... | |
GlobalWall | GetGlobalWall (string name) |
Gets the GlobalWall instance with the given name from this mod. More... | |
T | GetGlobalWall< T > () |
int | GetGoreSlot (string name) |
Shorthand for calling ModGore.GetGoreSlot(this.Name + '/' + name). More... | |
int | GetGoreSlot< T > () |
Same as the other GetGoreSlot, but assumes that the class name and internal name are the same. More... | |
ModItem | GetItem (string name) |
Gets the ModItem instance corresponding to the name. Because this method is in the Mod class, conflicts between mods are avoided. Returns null if no ModItem with the given name is found. More... | |
T | GetItem< T > () |
Same as the other GetItem, but assumes that the class name and internal name are the same. More... | |
LegacySoundStyle | GetLegacySoundSlot (SoundType type, string name) |
Shorthand for calling SoundLoader.GetLegacySoundSlot(type, this.Name + '/' + name). More... | |
ModWorld | GetModWorld (string name) |
Gets the ModWorld instance with the given name from this mod. More... | |
T | GetModWorld< T > () |
Same as the other GetModWorld, but assumes that the class name and internal name are the same. More... | |
ModMountData | GetMount (string name) |
Gets the ModMountData instance of this mod corresponding to the given name. Returns null if no ModMountData has the given name. More... | |
T | GetMount< T > () |
Music | GetMusic (string name) |
Shorthand for calling ModContent.GetMusic(this.FileName(name)). More... | |
ModNPC | GetNPC (string name) |
Gets the ModNPC of this mod corresponding to the given name. Returns null if no ModNPC with the given name is found. More... | |
T | GetNPC< T > () |
ModPacket | GetPacket (int capacity=256) |
Creates a ModPacket object that you can write to and then send between servers and clients. More... | |
ModPlayer | GetPlayer (string name) |
Gets the ModPlayer of this mod corresponding to the given name. Returns null if no ModPlayer with the given name is found. More... | |
T | GetPlayer< T > () |
ModPrefix | GetPrefix (string name) |
Gets the ModPrefix instance corresponding to the name. Because this method is in the Mod class, conflicts between mods are avoided. Returns null if no ModPrefix with the given name is found. More... | |
T | GetPrefix< T > () |
Same as the other GetPrefix, but assumes that the class name and internal name are the same. More... | |
ModProjectile | GetProjectile (string name) |
Gets the ModProjectile of this mod corresponding to the given name. Returns null if no ModProjectile with the given name is found. More... | |
T | GetProjectile< T > () |
SoundEffect | GetSound (string name) |
Shorthand for calling ModContent.GetSound(this.FileName(name)). More... | |
int | GetSoundSlot (SoundType type, string name) |
Shorthand for calling SoundLoader.GetSoundSlot(type, this.Name + '/' + name). More... | |
ModSurfaceBgStyle | GetSurfaceBgStyle (string name) |
Returns the surface background style corresponding to the given name. More... | |
T | GetSurfaceBgStyle< T > () |
int | GetSurfaceBgStyleSlot (string name) |
Returns the Slot of the surface background style corresponding to the given name. More... | |
int | GetSurfaceBgStyleSlot< T > () |
Texture2D | GetTexture (string name) |
Shorthand for calling ModContent.GetTexture(this.FileName(name)). More... | |
ModTile | GetTile (string name) |
Gets the ModTile of this mod corresponding to the given name. Returns null if no ModTile with the given name is found. More... | |
T | GetTile< T > () |
Same as the other GetTile, but assumes that the class name and internal name are the same. More... | |
ModTileEntity | GetTileEntity (string name) |
Gets the ModTileEntity of this mod corresponding to the given name. Returns null if no ModTileEntity with the given name is found. More... | |
T | GetTileEntity< T > () |
Same as the other GetTileEntity, but assumes that the class name and internal name are the same. More... | |
ModUgBgStyle | GetUgBgStyle (string name) |
Returns the underground background style corresponding to the given name. More... | |
T | GetUgBgStyle< T > () |
ModWall | GetWall (string name) |
Gets the ModWall of this mod corresponding to the given name. Returns null if no ModWall with the given name is found. More... | |
T | GetWall< T > () |
ModWaterfallStyle | GetWaterfallStyle (string name) |
Returns the waterfall style with the given name from this mod. More... | |
T | GetWaterfallStyle< T > () |
int | GetWaterfallStyleSlot (string name) |
Returns the waterfall style corresponding to the given name. More... | |
int | GetWaterfallStyleSlot< T > () |
ModWaterStyle | GetWaterStyle (string name) |
Returns the water style with the given name from this mod. More... | |
T | GetWaterStyle< T > () |
virtual void | HandlePacket (BinaryReader reader, int whoAmI) |
Called whenever a net message / packet is received from a client (if this is a server) or the server (if this is a client). whoAmI is the ID of whomever sent the packet (equivalent to the Main.myPlayer of the sender), and reader is used to read the binary data of the packet. More... | |
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 | HotKeyPressed (string name) |
Called when a hotkey is pressed. Check against the name to verify particular hotkey that was pressed. (Using the ModHotKey is more recommended.) More... | |
int | ItemType (string name) |
Gets the internal ID / type of the ModItem corresponding to the name. Returns 0 if no ModItem with the given name is found. More... | |
int | ItemType< T > () |
Same as the other ItemType, but assumes that the class name and internal name are the same. More... | |
virtual void | Load () |
Override this method to add most of your content to your mod. Here you will call other methods such as AddItem. This is guaranteed to be called after all content has been autoloaded. More... | |
virtual bool | LoadResource (string path, int length, Func< Stream > getStream) |
Hook for pre-loading resources More... | |
virtual void | LoadResourceFromStream (string path, int len, BinaryReader reader) |
virtual void | LoadResources () |
virtual void | MidUpdateDustTime () |
Called after Dust got updated, but before Time (day/night, events, etc.) gets updated. More... | |
virtual void | MidUpdateGoreProjectile () |
Called after Gores got updated, but before any Projectiles get updated. More... | |
virtual void | MidUpdateInvasionNet () |
Called after Invasions got updated. The only thing that is updated after this is the Network. More... | |
virtual void | MidUpdateItemDust () |
Called after Items got updated, but before any Dust gets updated. More... | |
virtual void | MidUpdateNPCGore () |
Called after NPCs got updated, but before any Gores get updated. More... | |
virtual void | MidUpdatePlayerNPC () |
Called after Players got updated, but before any NPCs get updated. More... | |
virtual void | MidUpdateProjectileItem () |
Gets called immediately after all Projectiles are updated, but before any Items get updated. More... | |
virtual void | MidUpdateTimeWorld () |
Called after Time got updated, but before the World gets updated. 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 | ModifySunLightColor (ref Color tileColor, ref Color backgroundColor) |
Allows you to modify color of light the sun emits. More... | |
virtual void | ModifyTransformMatrix (ref SpriteViewMatrix Transform) |
Allows you to set the transformation of the screen that is drawn. (Translations, rotations, scales, etc.) More... | |
int | MountType (string name) |
Gets the ID of the ModMountData instance corresponding to the given name. Returns 0 if no ModMountData has the given name. More... | |
int | MountType< T > () |
Same as the other MountType, but assumes that the class name and internal name are the same. More... | |
bool | MusicExists (string name) |
Shorthand for calling ModLoader.MusicExists(this.FileName(name)). More... | |
int | NPCType (string name) |
Gets the type of the ModNPC of this mod with the given name. Returns 0 if no ModNPC with the given name is found. More... | |
int | NPCType< T > () |
Same as the other NPCType, but assumes that the class name and internal name are the same. More... | |
virtual void | PostAddRecipes () |
This provides a hook into the mod-loading process immediately after recipes have been added. You can use this to edit recipes added by other mods. 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 | PostSetupContent () |
Allows you to load things in your mod after its content has been setup (arrays have been resized to fit the content, etc). More... | |
virtual void | PostUpdateEverything () |
Called after the Network got updated, this is the last hook that happens in an update. 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... | |
byte | PrefixType (string name) |
Gets the internal ID / type of the ModPrefix corresponding to the name. Returns 0 if no ModPrefix with the given name is found. More... | |
byte | PrefixType< T > () |
Same as the other PrefixType, but assumes that the class name and internal name are the same. 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 | 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... | |
int | ProjectileType (string name) |
Gets the type of the ModProjectile of this mod with the given name. Returns 0 if no ModProjectile with the given name is found. More... | |
int | ProjectileType< T > () |
Same as the other ProjectileType, but assumes that the class name and internal name are the same. More... | |
ModHotKey | RegisterHotKey (string name, string defaultKey) |
Registers a hotkey with a name and defaultKey. Use the returned ModHotKey to detect when buttons are pressed. Do this in a ModPlayer.ProcessTriggers. More... | |
bool | SoundExists (string name) |
Shorthand for calling ModLoader.SoundExists(this.FileName(name)). More... | |
bool | TextureExists (string name) |
Shorthand for calling ModLoader.TextureExists(this.FileName(name)). More... | |
int | TileEntityType (string name) |
Gets the type of the ModTileEntity of this mod with the given name. Returns -1 if no ModTileEntity with the given name is found. More... | |
int | TileEntityType< T > () |
Same as the other TileEntityType, but assumes that the class name and internal name are the same. More... | |
int | TileType (string name) |
Gets the type of the ModTile of this mod with the given name. Returns 0 if no ModTile with the given name is found. More... | |
int | TileType< T > () |
Same as the other TileType, but assumes that the class name and internal name are the same. More... | |
virtual void | Unload () |
This is called whenever this mod is unloaded from the game. Use it to undo changes that you've made in Load that aren't automatically handled (for example, modifying the texture of a vanilla item). Mods are guaranteed to be unloaded in the reverse order they were loaded in. More... | |
virtual void | UpdateMusic (ref int music) |
A legacy hook that you should no longer use. Use the version with two parameters instead. More... | |
virtual void | UpdateMusic (ref int music, ref MusicPriority priority) |
Allows you to determine what music should currently play. More... | |
virtual void | UpdateUI (GameTime gameTime) |
Ran every update and suitable for calling Update for UserInterface classes More... | |
int | WallType (string name) |
Gets the type of the ModWall of this mod with the given name. Returns 0 if no ModWall with the given name is found. More... | |
int | WallType< T > () |
Same as the other WallType, but assumes that the class name and internal name are the same. More... | |
Properties | |
Assembly | Code [get, set] |
The assembly code this is loaded when tModLoader loads this mod. More... | |
string | DisplayName [get, set] |
The display name of this mod in the Mods menu. More... | |
virtual uint | ExtraPlayerBuffSlots [get] |
The amount of extra buff slots this mod desires for Players. This value is checked after Mod.Load but before Mod.PostSetupContent. The actual number of buffs the player can use will be 22 plus the max value of all enabled mods. In-game use Player.MaxBuffs to check the maximum number of buffs. More... | |
bool | IsNetSynced [get] |
ILog | Logger [get, set] |
A logger with this mod's name for easy logging. More... | |
virtual string | Name [get] |
Stores the name of the mod. This name serves as the mod's identification, and also helps with saving everything your mod adds. By default this returns the name of the folder that contains all your code and stuff. More... | |
ModProperties | Properties = ModProperties.AutoLoadAll [get, protected set] |
ModSide | Side [get, set] |
The ModSide that controls how this mod is synced between client and server. More... | |
Version | tModLoaderVersion [get, set] |
The version of tModLoader that was being used when this mod was built. More... | |
virtual Version | Version [get] |
This version number of this mod. More... | |
Private Member Functions | |
void | AutoloadBackgrounds () |
void | AutoloadBuff (Type type) |
void | AutoloadCommand (Type type) |
void | AutoloadDust (Type type) |
void | AutoloadGlobalBgStyle (Type type) |
void | AutoloadGlobalBuff (Type type) |
void | AutoloadGlobalItem (Type type) |
void | AutoloadGlobalNPC (Type type) |
void | AutoloadGlobalProjectile (Type type) |
void | AutoloadGlobalRecipe (Type type) |
void | AutoloadGlobalTile (Type type) |
void | AutoloadGlobalWall (Type type) |
void | AutoloadGores (IList< Type > modGores) |
void | AutoloadItem (Type type) |
void | AutoloadLocalization () |
Loads .lang files More... | |
void | AutoloadModWorld (Type type) |
void | AutoloadMountData (Type type) |
void | AutoloadNPC (Type type) |
void | AutoloadPlayer (Type type) |
void | AutoloadPrefix (Type type) |
void | AutoloadProjectile (Type type) |
void | AutoloadSounds (IList< Type > modSounds) |
void | AutoloadSurfaceBgStyle (Type type) |
void | AutoloadTile (Type type) |
void | AutoloadTileEntity (Type type) |
void | AutoloadUgBgStyle (Type type) |
void | AutoloadWall (Type type) |
void | AutoloadWaterfallStyle (Type type) |
void | AutoloadWaterStyle (Type type) |
Music | LoadMusic (string path, string extension) |
bool | LoadResourceLegacy (string path, int length, Func< Stream > getStream) |
SoundEffect | LoadSound (Stream stream, int length, string extension) |
void | LoadTexture (string path, Stream stream, bool rawimg) |
Private Attributes | |
readonly Queue< Task > | AsyncLoadQueue = new Queue<Task>() |
IDisposable | fileHandle |
Mod is an abstract class that you will override. It serves as a central place from which the mod's contents are stored. It provides methods for you to use or override.
void Terraria.ModLoader.Mod.AddBackgroundTexture | ( | string | texture | ) |
Adds a texture to the list of background textures and assigns it a background texture slot.
texture | The texture. |
Definition at line 1393 of file Mod.cs.
References Terraria.ModLoader.ModContent.GetTexture().
Referenced by Terraria.ModLoader.Mod.AutoloadBackgrounds().
void Terraria.ModLoader.Mod.AddBossHeadTexture | ( | string | texture, |
int | npcType = -1 |
||
) |
Assigns a head texture that can be used by NPCs on the map.
texture | The texture. |
npcType | An optional npc id for NPCID.Sets.BossHeadTextures |
Definition at line 931 of file Mod.cs.
References Terraria.ModLoader.ModContent.GetTexture().
Referenced by Terraria.ModLoader.Mod.AutoloadNPC().
void Terraria.ModLoader.Mod.AddBuff | ( | string | name, |
ModBuff | buff, | ||
string | texture | ||
) |
Adds a type of buff to the game with the specified internal name and texture.
name | The name. |
buff | The buff. |
texture | The texture. |
Definition at line 976 of file Mod.cs.
References Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadBuff().
void Terraria.ModLoader.Mod.AddCommand | ( | string | name, |
ModCommand | mc | ||
) |
Manually add a Command during Load
Definition at line 1438 of file Mod.cs.
Referenced by Terraria.ModLoader.Mod.AutoloadCommand().
void Terraria.ModLoader.Mod.AddConfig | ( | string | name, |
ModConfig | mc | ||
) |
Definition at line 225 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
void Terraria.ModLoader.Mod.AddDust | ( | string | name, |
ModDust | dust, | ||
string | texture = "" |
||
) |
Adds a type of dust to your mod with the specified name. Create an instance of ModDust normally, preferably through the constructor of an overriding class. Leave the texture as an empty string to use the vanilla dust sprite sheet.
name | The name. |
dust | The dust. |
texture | The texture. |
Definition at line 485 of file Mod.cs.
References Terraria.ModLoader.ModContent.GetTexture(), and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadDust().
int Terraria.ModLoader.Mod.AddEquipTexture | ( | EquipTexture | equipTexture, |
ModItem | item, | ||
EquipType | type, | ||
string | name, | ||
string | texture, | ||
string | armTexture = "" , |
||
string | femaleTexture = "" |
||
) |
Adds an equipment texture of the specified type, internal name, and associated item to your mod. This method is different from the other AddEquipTexture in that you can specify the class of the equipment texture, thus allowing you to override EquipmentTexture's hooks. All other parameters are the same as the other AddEquipTexture.
equipTexture | The equip texture. |
item | The item. |
type | The type. |
name | The name. |
texture | The texture. |
armTexture | The arm texture (for body slots). |
femaleTexture | The female texture (for body slots), if missing the regular body texture is used. |
Definition at line 363 of file Mod.cs.
References Terraria.ModLoader.ModContent.GetTexture(), Terraria.ModLoader.ModItem.item, and Terraria.ModLoader.ModContent.TextureExists().
int Terraria.ModLoader.Mod.AddEquipTexture | ( | ModItem | item, |
EquipType | type, | ||
string | name, | ||
string | texture, | ||
string | armTexture = "" , |
||
string | femaleTexture = "" |
||
) |
Adds an equipment texture of the specified type, internal name, and associated item to your mod. (The item parameter may be null if you don't want to associate an item with the texture.) You can then get the ID for your texture by calling EquipLoader.GetEquipTexture, and using the EquipTexture's Slot property. If the EquipType is EquipType.Body, make sure that you also provide an armTexture and a femaleTexture. Returns the ID / slot that is assigned to the equipment texture.
item | The item. |
type | The type. |
name | The name. |
texture | The texture. |
armTexture | The arm texture (for body slots). |
femaleTexture | The female texture (for body slots), if missing the regular body texture is used. |
Definition at line 345 of file Mod.cs.
References Terraria.ModLoader.Mod.AddEquipTexture().
Referenced by Terraria.ModLoader.Mod.AddEquipTexture(), and Terraria.ModLoader.Mod.AutoloadItem().
void Terraria.ModLoader.Mod.AddGlobalBgStyle | ( | string | name, |
GlobalBgStyle | globalBgStyle | ||
) |
Adds the given global background style with the given name to this mod.
name | The name. |
globalBgStyle | The global bg style. |
Definition at line 1232 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalBgStyle().
void Terraria.ModLoader.Mod.AddGlobalBuff | ( | string | name, |
GlobalBuff | globalBuff | ||
) |
Adds the given GlobalBuff instance to this mod using the provided name.
name | The name. |
globalBuff | The global buff. |
Definition at line 1025 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalBuff().
void Terraria.ModLoader.Mod.AddGlobalItem | ( | string | name, |
GlobalItem | globalItem | ||
) |
Adds the given GlobalItem instance to this mod with the provided name.
name | The name. |
globalItem | The global item. |
Definition at line 295 of file Mod.cs.
References Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalItem().
void Terraria.ModLoader.Mod.AddGlobalNPC | ( | string | name, |
GlobalNPC | globalNPC | ||
) |
Adds the given GlobalNPC instance to this mod with the provided name.
name | The name. |
globalNPC | The global NPC. |
Definition at line 871 of file Mod.cs.
References Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalNPC().
void Terraria.ModLoader.Mod.AddGlobalProjectile | ( | string | name, |
GlobalProjectile | globalProjectile | ||
) |
Adds the given GlobalProjectile instance to this mod with the provided name.
name | The name. |
globalProjectile | The global projectile. |
Definition at line 787 of file Mod.cs.
References Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalProjectile().
void Terraria.ModLoader.Mod.AddGlobalRecipe | ( | string | name, |
GlobalRecipe | globalRecipe | ||
) |
Manually add a Global Recipe during Load
name | The name. |
globalRecipe | The global recipe. |
Definition at line 1413 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalRecipe().
void Terraria.ModLoader.Mod.AddGlobalTile | ( | string | name, |
GlobalTile | globalTile | ||
) |
Adds the given GlobalTile instance to this mod with the provided name.
name | The name. |
globalTile | The global tile. |
Definition at line 587 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalTile().
void Terraria.ModLoader.Mod.AddGlobalWall | ( | string | name, |
GlobalWall | globalWall | ||
) |
Adds the given GlobalWall instance to this mod with the provided name.
name | The name. |
globalWall | The global wall. |
Definition at line 713 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalWall().
void Terraria.ModLoader.Mod.AddGore | ( | string | texture, |
ModGore | modGore = null |
||
) |
Adds the given texture to the game as a custom gore, with the given custom gore behavior. If no custom gore behavior is provided, the custom gore will have the default vanilla behavior.
texture | The texture. |
modGore | The mod gore. |
Definition at line 1330 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadGores().
void Terraria.ModLoader.Mod.AddItem | ( | string | name, |
ModItem | item | ||
) |
Adds a type of item to your mod with the specified internal name. This method should be called in Load. You can obtain an instance of ModItem by overriding it then creating an instance of the subclass.
name | The name. |
item | The item. |
System.Exception | You tried to add 2 ModItems with the same name: " + name + ". Maybe 2 classes share a classname but in different namespaces while autoloading or you manually called AddItem with 2 items of the same name. |
Definition at line 240 of file Mod.cs.
References Terraria.ModLoader.ModItem.item, Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadItem().
void Terraria.ModLoader.Mod.AddModWorld | ( | string | name, |
ModWorld | modWorld | ||
) |
Adds a ModWorld to this mod with the given name.
name | The name. |
modWorld | The mod world. |
Definition at line 1135 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadModWorld().
void Terraria.ModLoader.Mod.AddMount | ( | string | name, |
ModMountData | mount, | ||
string | texture, | ||
IDictionary< MountTextureType, string > | extraTextures = null |
||
) |
Adds the given mount to the game with the given name and texture. The extraTextures dictionary should optionally map types of mount textures to the texture paths you want to include.
name | The name. |
mount | The mount. |
texture | The texture. |
extraTextures | The extra textures. |
Definition at line 1051 of file Mod.cs.
References Terraria.ModLoader.ModContent.GetTexture(), Terraria.ModLoader.ContentInstance< T >.Register(), and Terraria.ModLoader.ModContent.TextureExists().
Referenced by Terraria.ModLoader.Mod.AutoloadMountData().
void Terraria.ModLoader.Mod.AddMusicBox | ( | int | musicSlot, |
int | itemType, | ||
int | tileType, | ||
int | tileFrameY = 0 |
||
) |
Allows you to tie a music ID, and item ID, and a tile ID together to form a music box. When music with the given ID is playing, equipped music boxes have a chance to change their ID to the given item type. When an item with the given item type is equipped, it will play the music that has musicSlot as its ID. When a tile with the given type and Y-frame is nearby, if its X-frame is >= 36, it will play the music that has musicSlot as its ID.
musicSlot | The music slot. |
itemType | Type of the item. |
tileType | Type of the tile. |
tileFrameY | The tile frame y. |
System.ArgumentOutOfRangeException | Cannot assign music box to vanilla music ID " + musicSlot or Music ID " + musicSlot + " does not exist or Cannot assign music box to vanilla item ID " + itemType or Item ID " + itemType + " does not exist or Cannot assign music box to vanilla tile ID " + tileType or Tile ID " + tileType + " does not exist </exception> <exception cref="System.ArgumentException"> Music ID " + musicSlot + " has already been assigned a music box or Item ID " + itemType + " has already been assigned a music or or Y-frame must be divisible by 36 |
Definition at line 1475 of file Mod.cs.
References Terraria.ModLoader.ItemLoader.GetItem(), Terraria.ModLoader.TileLoader.GetTile(), and Terraria.ModLoader.SoundLoader.SoundCount().
void Terraria.ModLoader.Mod.AddNPC | ( | string | name, |
ModNPC | npc | ||
) |
Adds a type of NPC to the game with the specified name and texture. Also allows you to give the NPC alternate textures.
name | The name. |
npc | The NPC. |
Definition at line 824 of file Mod.cs.
References Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadNPC().
void Terraria.ModLoader.Mod.AddNPCHeadTexture | ( | int | npcType, |
string | texture | ||
) |
Assigns a head texture to the given town NPC type.
npcType | Type of the NPC. |
texture | The texture. |
MissingResourceException |
Definition at line 909 of file Mod.cs.
References Terraria.ModLoader.ModContent.GetTexture().
Referenced by Terraria.ModLoader.Mod.AutoloadNPC().
void Terraria.ModLoader.Mod.AddPlayer | ( | string | name, |
ModPlayer | player | ||
) |
Adds a type of ModPlayer to this mod. All ModPlayer types will be newly created and attached to each player that is loaded.
name | The name. |
player | The player. |
Definition at line 948 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadPlayer().
void Terraria.ModLoader.Mod.AddPrefix | ( | string | name, |
ModPrefix | prefix | ||
) |
Adds a prefix to your mod with the specified internal name. This method should be called in Load. You can obtain an instance of ModPrefix by overriding it then creating an instance of the subclass.
name | The name. |
prefix | The prefix. |
System.Exception | You tried to add 2 ModItems with the same name: " + name + ". Maybe 2 classes share a classname but in different namespaces while autoloading or you manually called AddItem with 2 items of the same name. |
Definition at line 431 of file Mod.cs.
References Terraria.ModLoader.ModPrefix.Category, Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadPrefix().
void Terraria.ModLoader.Mod.AddProjectile | ( | string | name, |
ModProjectile | projectile | ||
) |
Adds a type of projectile to the game with the specified name.
name | The name. |
projectile | The projectile. |
Definition at line 740 of file Mod.cs.
References Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadProjectile().
|
virtual |
|
virtual |
Adds the given sound file to the game as the given type of sound and with the given custom sound playing. If no ModSound instance is provided, the custom sound will play in a similar manner as the default vanilla ones.
type | The type. |
soundPath | The sound path. |
modSound | The mod sound. |
Definition at line 1362 of file Mod.cs.
References Terraria.ModLoader.ModContent.GetSound().
Referenced by Terraria.ModLoader.Mod.AutoloadSounds().
void Terraria.ModLoader.Mod.AddSurfaceBgStyle | ( | string | name, |
ModSurfaceBgStyle | surfaceBgStyle | ||
) |
Adds the given surface background style with the given name to this mod.
name | The name. |
surfaceBgStyle | The surface bg style. |
Definition at line 1195 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadSurfaceBgStyle().
void Terraria.ModLoader.Mod.AddTexture | ( | string | name, |
Texture2D | texture | ||
) |
Shorthand for calling ModLoader.AddTexture(this.FileName(name), texture).
name | The name. |
texture | The texture. |
Terraria.ModLoader.Exceptions.ModNameException | Texture already exist: " + name |
Definition at line 1598 of file Mod.cs.
References Terraria.ModLoader.Mod.TextureExists().
void Terraria.ModLoader.Mod.AddTile | ( | string | name, |
ModTile | tile, | ||
string | texture | ||
) |
Adds a type of tile to the game with the specified name and texture.
name | The name. |
tile | The tile. |
texture | The texture. |
Definition at line 535 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadTile().
void Terraria.ModLoader.Mod.AddTileEntity | ( | string | name, |
ModTileEntity | entity | ||
) |
Manually add a tile entity during Load.
Definition at line 617 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadTileEntity().
void Terraria.ModLoader.Mod.AddTranslation | ( | ModTranslation | translation | ) |
Adds a ModTranslation to the game so that you can use Language.GetText to get a LocalizedText.
Definition at line 1544 of file Mod.cs.
References Terraria.ModLoader.ModTranslation.Key.
Referenced by Terraria.ModLoader.Mod.AutoloadLocalization().
void Terraria.ModLoader.Mod.AddUgBgStyle | ( | string | name, |
ModUgBgStyle | ugBgStyle | ||
) |
Adds the given underground background style with the given name to this mod.
name | The name. |
ugBgStyle | The ug bg style. |
Definition at line 1167 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadUgBgStyle().
void Terraria.ModLoader.Mod.AddWall | ( | string | name, |
ModWall | wall, | ||
string | texture | ||
) |
Adds a type of wall to the game with the specified name and texture.
name | The name. |
wall | The wall. |
texture | The texture. |
Definition at line 669 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadWall().
void Terraria.ModLoader.Mod.AddWaterfallStyle | ( | string | name, |
ModWaterfallStyle | waterfallStyle, | ||
string | texture | ||
) |
Adds the given waterfall style to the game with the given name and texture path.
name | The name. |
waterfallStyle | The waterfall style. |
texture | The texture. |
Definition at line 1292 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadWaterfallStyle().
void Terraria.ModLoader.Mod.AddWaterStyle | ( | string | name, |
ModWaterStyle | waterStyle, | ||
string | texture, | ||
string | blockTexture | ||
) |
Adds the given water style to the game with the given name, texture path, and block texture path.
name | The name. |
waterStyle | The water style. |
texture | The texture. |
blockTexture | The block texture. |
Definition at line 1261 of file Mod.cs.
References Terraria.ModLoader.ContentInstance< T >.Register().
Referenced by Terraria.ModLoader.Mod.AutoloadWaterStyle().
|
private |
Definition at line 532 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddBackgroundTexture(), and Terraria.ModLoader.Mod.Name.
|
private |
Definition at line 490 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddBuff(), Terraria.ModLoader.ModBuff.Autoload(), and Terraria.ModLoader.ModBuff.Name.
|
private |
Definition at line 636 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddCommand().
|
private |
Definition at line 378 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddDust(), Terraria.ModLoader.ModDust.Autoload(), and Terraria.ModLoader.ModDust.Name.
|
private |
Definition at line 556 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGlobalBgStyle(), Terraria.ModLoader.GlobalBgStyle.Autoload(), and Terraria.ModLoader.GlobalBgStyle.Name.
|
private |
Definition at line 500 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGlobalBuff(), Terraria.ModLoader.GlobalBuff.Autoload(), and Terraria.ModLoader.GlobalBuff.Name.
|
private |
Definition at line 360 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGlobalItem(), Terraria.ModLoader.GlobalItem.Autoload(), and Terraria.ModLoader.GlobalItem.Name.
|
private |
Definition at line 472 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGlobalNPC(), Terraria.ModLoader.GlobalNPC.Autoload(), and Terraria.ModLoader.GlobalNPC.Name.
|
private |
Definition at line 444 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGlobalProjectile(), Terraria.ModLoader.GlobalProjectile.Autoload(), and Terraria.ModLoader.GlobalProjectile.Name.
|
private |
Definition at line 627 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGlobalRecipe(), Terraria.ModLoader.GlobalRecipe.Autoload(), and Terraria.ModLoader.GlobalRecipe.Name.
|
private |
Definition at line 398 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGlobalTile(), Terraria.ModLoader.GlobalTile.Autoload(), and Terraria.ModLoader.GlobalTile.Name.
|
private |
Definition at line 426 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGlobalWall(), Terraria.ModLoader.GlobalWall.Autoload(), and Terraria.ModLoader.GlobalWall.Name.
|
private |
Definition at line 586 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddGore(), and Terraria.ModLoader.Mod.Name.
|
private |
Definition at line 346 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddEquipTexture(), Terraria.ModLoader.Mod.AddItem(), Terraria.ModLoader.ModItem.Autoload(), Terraria.ModLoader.ModItem.Name, and Terraria.ModLoader.ModItem.Texture.
|
private |
Loads .lang files
Definition at line 647 of file ModInternals.cs.
References Terraria.ModLoader.ModTranslation.AddTranslation(), Terraria.ModLoader.Mod.AddTranslation(), and Terraria.ModLoader.Mod.CreateTranslation().
|
private |
Definition at line 523 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddModWorld(), Terraria.ModLoader.ModWorld.Autoload(), and Terraria.ModLoader.ModWorld.Name.
|
private |
Definition at line 509 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddMount(), and Terraria.ModLoader.ModMountData.Name.
|
private |
Definition at line 453 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddBossHeadTexture(), Terraria.ModLoader.Mod.AddNPC(), Terraria.ModLoader.Mod.AddNPCHeadTexture(), Terraria.ModLoader.ModNPC.Autoload(), Terraria.ModLoader.ModNPC.BossHeadTexture, Terraria.ModLoader.ModNPC.HeadTexture, Terraria.ModLoader.ModNPC.Name, and Terraria.ModLoader.ModNPC.npc.
|
private |
Definition at line 481 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddPlayer(), Terraria.ModLoader.ModPlayer.Autoload(), and Terraria.ModLoader.ModPlayer.Name.
|
private |
Definition at line 369 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddPrefix(), Terraria.ModLoader.ModPrefix.Autoload(), and Terraria.ModLoader.ModPrefix.Name.
|
private |
Definition at line 435 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddProjectile(), Terraria.ModLoader.ModProjectile.Autoload(), and Terraria.ModLoader.ModProjectile.Name.
|
private |
Definition at line 598 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddSound(), and Terraria.ModLoader.Mod.Name.
|
private |
Definition at line 547 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddSurfaceBgStyle(), Terraria.ModLoader.ModSurfaceBgStyle.Autoload(), and Terraria.ModLoader.ModSurfaceBgStyle.Name.
|
private |
Definition at line 388 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddTile(), Terraria.ModLoader.ModTile.Autoload(), and Terraria.ModLoader.ModTile.Name.
|
private |
Definition at line 407 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddTileEntity(), Terraria.ModLoader.ModTileEntity.Autoload(), and Terraria.ModLoader.ModTileEntity.Name.
|
private |
Definition at line 538 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddUgBgStyle(), Terraria.ModLoader.ModUgBgStyle.Autoload(), and Terraria.ModLoader.ModUgBgStyle.Name.
|
private |
Definition at line 416 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddWall(), Terraria.ModLoader.ModWall.Autoload(), and Terraria.ModLoader.ModWall.Name.
|
private |
Definition at line 576 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddWaterfallStyle(), Terraria.ModLoader.ModWaterfallStyle.Autoload(), and Terraria.ModLoader.ModWaterfallStyle.Name.
|
private |
Definition at line 565 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AddWaterStyle(), Terraria.ModLoader.ModWaterStyle.Autoload(), and Terraria.ModLoader.ModWaterStyle.Name.
int Terraria.ModLoader.Mod.BuffType | ( | string | name | ) |
int Terraria.ModLoader.Mod.BuffType< T > | ( | ) |
Same as the other BuffType, but assumes that the class name and internal name are the same.
T |
T | : | ModBuff | |
T | : | ModContent.BuffType<T>() |
|
virtual |
|
virtual |
Close is called before Unload, and may be called at any time when mod unloading is imminent (such as when downloading an update, or recompiling) Use this to release any additional file handles, or stop streaming music. Make sure to call base.Close()
at the end May be called multiple times before Unload
Definition at line 136 of file Mod.cs.
References Terraria.ModLoader.Mod.fileHandle.
ModTranslation Terraria.ModLoader.Mod.CreateTranslation | ( | string | key | ) |
Creates a ModTranslation object that you can use in AddTranslation.
key | The key for the ModTranslation. The full key will be Mods.ModName.key |
Referenced by Terraria.ModLoader.Mod.AutoloadLocalization().
int Terraria.ModLoader.Mod.DustType | ( | string | name | ) |
int Terraria.ModLoader.Mod.DustType< T > | ( | ) |
Same as the other DustType, but assumes that the class name and internal name are the same.
T |
T | : | ModDust | |
T | : | ModContent.DustType<T>() |
bool Terraria.ModLoader.Mod.EffectExists | ( | string | name | ) |
Used to check if a custom Effect exists
bool Terraria.ModLoader.Mod.FileExists | ( | string | name | ) |
Shorthand for calling ModLoader.FileExists(this.FileName(name)). Note that file extensions are used here.
name | The name. |
Referenced by Terraria.ModLoader.ModContent.FileExists().
bool Terraria.ModLoader.Mod.FontExists | ( | string | name | ) |
Used to check if a custom SpriteFont exists
sbyte Terraria.ModLoader.Mod.GetAccessorySlot | ( | string | name, |
EquipType | type | ||
) |
Same as GetEquipSlot, except returns the number as an sbyte (signed byte) for your convenience.
name | The name. |
type |
int Terraria.ModLoader.Mod.GetBackgroundSlot | ( | string | name | ) |
Gets the texture slot corresponding to the specified texture name. Shorthand for calling BackgroundTextureLoader.GetBackgroundSlot(this.Name + '/' + name).
name | The name. |
ModBuff Terraria.ModLoader.Mod.GetBuff | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetBuff< T > | ( | ) |
T | : | ModBuff | |
T | : | ModContent.GetInstance<T>() |
ModConfig Terraria.ModLoader.Mod.GetConfig | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetConfig< T > | ( | ) |
T | : | ModConfig | |
T | : | T | |
T | : | GetConfig | |
T | : | typeof | |
T | : | T | |
T | : | Name |
ModDust Terraria.ModLoader.Mod.GetDust | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetDust< T > | ( | ) |
Same as the other GetDust, but assumes that the class name and internal name are the same.
T |
T | : | ModDust | |
T | : | ModContent.GetInstance<T>() |
Effect Terraria.ModLoader.Mod.GetEffect | ( | string | name | ) |
int Terraria.ModLoader.Mod.GetEquipSlot | ( | string | name, |
EquipType | type | ||
) |
Gets the slot/ID of the equipment texture corresponding to the given name. Returns -1 if no EquipTexture with the given name is found.
name | The name. |
type |
EquipTexture Terraria.ModLoader.Mod.GetEquipTexture | ( | string | name, |
EquipType | type | ||
) |
Gets the EquipTexture instance corresponding to the name and EquipType. Returns null if no EquipTexture with the given name and EquipType is found.
name | The name. |
type | The type. |
byte[] Terraria.ModLoader.Mod.GetFileBytes | ( | string | name | ) |
Retrieve contents of files within the tmod file
name | The name. |
Referenced by Terraria.ModLoader.ModContent.GetFileBytes().
Stream Terraria.ModLoader.Mod.GetFileStream | ( | string | name, |
bool | newFileStream = false |
||
) |
Retrieve contents of files within the tmod file
name | The name. |
Referenced by Terraria.ModLoader.ModContent.OpenRead().
DynamicSpriteFont Terraria.ModLoader.Mod.GetFont | ( | string | name | ) |
GlobalBgStyle Terraria.ModLoader.Mod.GetGlobalBgStyle | ( | string | name | ) |
Returns the global background style corresponding to the given name.
name | The name. |
T Terraria.ModLoader.Mod.GetGlobalBgStyle< T > | ( | ) |
T | : | GlobalBgStyle | |
T | : | ModContent.GetInstance<T>() |
GlobalBuff Terraria.ModLoader.Mod.GetGlobalBuff | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetGlobalBuff< T > | ( | ) |
T | : | GlobalBuff | |
T | : | ModContent.GetInstance<T>() |
GlobalItem Terraria.ModLoader.Mod.GetGlobalItem | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetGlobalItem< T > | ( | ) |
Same as the other GetGlobalItem, but assumes that the class name and internal name are the same.
T |
T | : | GlobalItem | |
T | : | T | |
T | : | GetGlobalItem | |
T | : | typeof | |
T | : | T | |
T | : | Name |
GlobalNPC Terraria.ModLoader.Mod.GetGlobalNPC | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetGlobalNPC< T > | ( | ) |
T | : | GlobalNPC | |
T | : | ModContent.GetInstance<T>() |
GlobalProjectile Terraria.ModLoader.Mod.GetGlobalProjectile | ( | string | name | ) |
Gets the GlobalProjectile instance with the given name from this mod.
name | The name. |
T Terraria.ModLoader.Mod.GetGlobalProjectile< T > | ( | ) |
T | : | GlobalProjectile | |
T | : | ModContent.GetInstance<T>() |
GlobalRecipe Terraria.ModLoader.Mod.GetGlobalRecipe | ( | string | name | ) |
Gets the global recipe corresponding to the specified name.
name | The name. |
T Terraria.ModLoader.Mod.GetGlobalRecipe< T > | ( | ) |
T | : | GlobalRecipe | |
T | : | ModContent.GetInstance<T>() |
GlobalTile Terraria.ModLoader.Mod.GetGlobalTile | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetGlobalTile< T > | ( | ) |
Same as the other GetGlobalTile, but assumes that the class name and internal name are the same.
T |
T | : | GlobalTile | |
T | : | ModContent.GetInstance<T>() |
GlobalWall Terraria.ModLoader.Mod.GetGlobalWall | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetGlobalWall< T > | ( | ) |
T | : | GlobalWall | |
T | : | ModContent.GetInstance<T>() |
int Terraria.ModLoader.Mod.GetGoreSlot | ( | string | name | ) |
int Terraria.ModLoader.Mod.GetGoreSlot< T > | ( | ) |
Same as the other GetGoreSlot, but assumes that the class name and internal name are the same.
T |
T | : | ModGore | |
T | : | GetGoreSlot | |
T | : | typeof | |
T | : | T | |
T | : | Name |
ModItem Terraria.ModLoader.Mod.GetItem | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetItem< T > | ( | ) |
Same as the other GetItem, but assumes that the class name and internal name are the same.
T |
T | : | ModItem | |
T | : | ModContent.GetInstance<T>() |
LegacySoundStyle Terraria.ModLoader.Mod.GetLegacySoundSlot | ( | SoundType | type, |
string | name | ||
) |
Shorthand for calling SoundLoader.GetLegacySoundSlot(type, this.Name + '/' + name).
type | The type. |
name | The name. |
ModWorld Terraria.ModLoader.Mod.GetModWorld | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetModWorld< T > | ( | ) |
Same as the other GetModWorld, but assumes that the class name and internal name are the same.
T |
T | : | ModWorld | |
T | : | ModContent.GetInstance<T>() |
ModMountData Terraria.ModLoader.Mod.GetMount | ( | string | name | ) |
Gets the ModMountData instance of this mod corresponding to the given name. Returns null if no ModMountData has the given name.
name | The name. |
T Terraria.ModLoader.Mod.GetMount< T > | ( | ) |
T | : | ModMountData | |
T | : | ModContent.GetInstance<T>() |
Music Terraria.ModLoader.Mod.GetMusic | ( | string | name | ) |
Shorthand for calling ModContent.GetMusic(this.FileName(name)).
name | The name. |
MissingResourceException |
Definition at line 1634 of file Mod.cs.
Referenced by Terraria.ModLoader.ModContent.GetMusic().
ModNPC Terraria.ModLoader.Mod.GetNPC | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetNPC< T > | ( | ) |
T | : | ModNPC | |
T | : | ModContent.GetInstance<T>() |
ModPacket Terraria.ModLoader.Mod.GetPacket | ( | int | capacity = 256 | ) |
Creates a ModPacket object that you can write to and then send between servers and clients.
capacity | The capacity. |
System.Exception | Cannot get packet for " + Name + " because it does not exist on the other side |
Definition at line 1693 of file Mod.cs.
References Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ModNet.NetModCount.
ModPlayer Terraria.ModLoader.Mod.GetPlayer | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetPlayer< T > | ( | ) |
T | : | ModPlayer | |
T | : | ModContent.GetInstance<T>() |
ModPrefix Terraria.ModLoader.Mod.GetPrefix | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetPrefix< T > | ( | ) |
Same as the other GetPrefix, but assumes that the class name and internal name are the same.
T |
T | : | ModPrefix | |
T | : | ModContent.GetInstance<T>() |
ModProjectile Terraria.ModLoader.Mod.GetProjectile | ( | string | name | ) |
Gets the ModProjectile of this mod corresponding to the given name. Returns null if no ModProjectile with the given name is found.
name | The name. |
T Terraria.ModLoader.Mod.GetProjectile< T > | ( | ) |
T | : | ModProjectile | |
T | : | ModContent.GetInstance<T>() |
SoundEffect Terraria.ModLoader.Mod.GetSound | ( | string | name | ) |
Shorthand for calling ModContent.GetSound(this.FileName(name)).
name | The name. |
MissingResourceException |
Definition at line 1614 of file Mod.cs.
Referenced by Terraria.ModLoader.ModContent.GetSound().
int Terraria.ModLoader.Mod.GetSoundSlot | ( | SoundType | type, |
string | name | ||
) |
Shorthand for calling SoundLoader.GetSoundSlot(type, this.Name + '/' + name).
type | The type. |
name | The name. |
ModSurfaceBgStyle Terraria.ModLoader.Mod.GetSurfaceBgStyle | ( | string | name | ) |
Returns the surface background style corresponding to the given name.
name | The name. |
T Terraria.ModLoader.Mod.GetSurfaceBgStyle< T > | ( | ) |
T | : | ModSurfaceBgStyle | |
T | : | ModContent.GetInstance<T>() |
int Terraria.ModLoader.Mod.GetSurfaceBgStyleSlot | ( | string | name | ) |
Returns the Slot of the surface background style corresponding to the given name.
name | The name. |
int Terraria.ModLoader.Mod.GetSurfaceBgStyleSlot< T > | ( | ) |
T | : | ModSurfaceBgStyle | |
T | : | GetSurfaceBgStyleSlot | |
T | : | typeof | |
T | : | T | |
T | : | Name |
Texture2D Terraria.ModLoader.Mod.GetTexture | ( | string | name | ) |
Shorthand for calling ModContent.GetTexture(this.FileName(name)).
MissingResourceException |
Definition at line 1578 of file Mod.cs.
ModTile Terraria.ModLoader.Mod.GetTile | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetTile< T > | ( | ) |
Same as the other GetTile, but assumes that the class name and internal name are the same.
T |
T | : | ModTile | |
T | : | ModContent.GetInstance<T>() |
ModTileEntity Terraria.ModLoader.Mod.GetTileEntity | ( | string | name | ) |
Gets the ModTileEntity of this mod corresponding to the given name. Returns null if no ModTileEntity with the given name is found.
name | The name. |
T Terraria.ModLoader.Mod.GetTileEntity< T > | ( | ) |
Same as the other GetTileEntity, but assumes that the class name and internal name are the same.
T |
T | : | ModTileEntity | |
T | : | ModContent.GetInstance<T>() |
ModUgBgStyle Terraria.ModLoader.Mod.GetUgBgStyle | ( | string | name | ) |
Returns the underground background style corresponding to the given name.
name | The name. |
T Terraria.ModLoader.Mod.GetUgBgStyle< T > | ( | ) |
T | : | ModUgBgStyle | |
T | : | ModContent.GetInstance<T>() |
ModWall Terraria.ModLoader.Mod.GetWall | ( | string | name | ) |
T Terraria.ModLoader.Mod.GetWall< T > | ( | ) |
T | : | ModWall | |
T | : | ModContent.GetInstance<T>() |
ModWaterfallStyle Terraria.ModLoader.Mod.GetWaterfallStyle | ( | string | name | ) |
Returns the waterfall style with the given name from this mod.
name | The name. |
T Terraria.ModLoader.Mod.GetWaterfallStyle< T > | ( | ) |
T | : | ModWaterfallStyle | |
T | : | ModContent.GetInstance<T>() |
int Terraria.ModLoader.Mod.GetWaterfallStyleSlot | ( | string | name | ) |
Returns the waterfall style corresponding to the given name.
name | The name. |
int Terraria.ModLoader.Mod.GetWaterfallStyleSlot< T > | ( | ) |
T | : | ModWaterfallStyle | |
T | : | GetWaterfallStyleSlot | |
T | : | typeof | |
T | : | T | |
T | : | Name |
ModWaterStyle Terraria.ModLoader.Mod.GetWaterStyle | ( | string | name | ) |
Returns the water style with the given name from this mod.
name | The name. |
T Terraria.ModLoader.Mod.GetWaterStyle< T > | ( | ) |
T | : | ModWaterStyle | |
T | : | ModContent.GetInstance<T>() |
|
virtual |
Called whenever a net message / packet is received from a client (if this is a server) or the server (if this is a client). whoAmI is the ID of whomever sent the packet (equivalent to the Main.myPlayer of the sender), and reader is used to read the binary data of the packet.
reader | The reader. |
whoAmI | The player the message is from. |
Definition at line 44 of file ModHooks.cs.
|
virtual |
Allows you to modify net message / packet information that is received before the game can act on it.
messageType | Type of the message. |
reader | The reader. |
playerNumber | The player number the message is from. |
Definition at line 54 of file ModHooks.cs.
|
virtual |
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.
Definition at line 61 of file ModHooks.cs.
|
virtual |
Called when a hotkey is pressed. Check against the name to verify particular hotkey that was pressed. (Using the ModHotKey is more recommended.)
name | The display name of the hotkey. |
Definition at line 36 of file ModHooks.cs.
int Terraria.ModLoader.Mod.ItemType | ( | string | name | ) |
Gets the internal ID / type of the ModItem corresponding to the name. Returns 0 if no ModItem with the given name is found.
name | The name. |
Referenced by Terraria.ModLoader.ModRecipe.AddIngredient(), Terraria.ModLoader.IO.ItemIO.Load(), Terraria.ModLoader.IO.ItemIO.LoadLegacy(), and Terraria.ModLoader.ModRecipe.SetResult().
int Terraria.ModLoader.Mod.ItemType< T > | ( | ) |
Same as the other ItemType, but assumes that the class name and internal name are the same.
T |
T | : | ModItem | |
T | : | ModContent.ItemType<T>() |
|
virtual |
|
private |
Definition at line 109 of file ModInternals.cs.
References Terraria.ModLoader.Mod.Name.
Referenced by Terraria.ModLoader.Mod.LoadResource().
|
virtual |
Hook for pre-loading resources
path | The path of the resource within the tmod |
length | The length of the uncompressed resource |
getStream | A function which returns a stream containing the file content |
Definition at line 149 of file Mod.cs.
References Terraria.ModLoader.Mod.LoadMusic(), Terraria.ModLoader.Mod.LoadResourceLegacy(), Terraria.ModLoader.Mod.LoadSound(), Terraria.ModLoader.Mod.LoadTexture(), Terraria.ModLoader.Mod.Name, Terraria.ModLoader.Mod.tModLoaderVersion, and Terraria.ModLoader.Mod.Version.
Referenced by Terraria.ModLoader.Mod.LoadResources().
|
virtual |
Definition at line 194 of file Mod.cs.
Referenced by Terraria.ModLoader.Mod.LoadResourceLegacy().
|
private |
Definition at line 186 of file Mod.cs.
References Terraria.ModLoader.Mod.LoadResourceFromStream().
Referenced by Terraria.ModLoader.Mod.LoadResource().
|
virtual |
Definition at line 109 of file Mod.cs.
References Terraria.ModLoader.Mod.fileHandle, and Terraria.ModLoader.Mod.LoadResource().
|
private |
Definition at line 85 of file ModInternals.cs.
References Terraria.ModLoader.Audio.MusicStreamingOGG.Convert().
Referenced by Terraria.ModLoader.Mod.LoadResource().
|
private |
Definition at line 60 of file ModInternals.cs.
References Terraria.ModLoader.Mod.AsyncLoadQueue, Terraria.ModLoader.IO.ImageIO.PngToTexture2DAsync(), and Terraria.ModLoader.IO.ImageIO.RawToTexture2DAsync().
Referenced by Terraria.ModLoader.Mod.LoadResource().
|
virtual |
Called after Dust got updated, but before Time (day/night, events, etc.) gets updated.
If you are looking to hook an earlier part of the update process, see MidUpdateItemDust. If you are looking to hook a later part of the update process, see MidUpdateTimeWorld.
Definition at line 139 of file ModHooks.cs.
|
virtual |
Called after Gores got updated, but before any Projectiles get updated.
If you are looking to hook an earlier part of the update process, see MidUpdateNPCGore. If you are looking to hook a later part of the update process, see MidUpdateProjectileItem.
Definition at line 112 of file ModHooks.cs.
|
virtual |
Called after Invasions got updated. The only thing that is updated after this is the Network.
If you are looking to hook an earlier part of the update process, see MidUpdateTimeWorld. If you are looking to hook even after the Network is updated, see PostUpdateEverything.
Definition at line 157 of file ModHooks.cs.
|
virtual |
Called after Items got updated, but before any Dust gets updated.
If you are looking to hook an earlier part of the update process, see MidUpdateProjectileItem. If you are looking to hook a later part of the update process, see MidUpdateDustTime.
Definition at line 130 of file ModHooks.cs.
|
virtual |
Called after NPCs got updated, but before any Gores get updated.
If you are looking to hook an earlier part of the update process, see MidUpdatePlayerNPC. If you are looking to hook a later part of the update process, see MidUpdateGoreProjectile.
Definition at line 103 of file ModHooks.cs.
|
virtual |
Called after Players got updated, but before any NPCs get updated.
If you are looking to hook an earlier part of the update process, see PreUpdateEntities. If you are looking to hook a later part of the update process, see MidUpdateNPCGore.
Definition at line 94 of file ModHooks.cs.
|
virtual |
Gets called immediately after all Projectiles are updated, but before any Items get updated.
If you are looking to hook an earlier part of the update process, see MidUpdateGoreProjectile. If you are looking to hook a later part of the update process, see MidUpdateItemDust.
Definition at line 121 of file ModHooks.cs.
|
virtual |
Called after Time got updated, but before the World gets updated.
If you are looking to hook an earlier part of the update process, see MidUpdateDustTime. If you are looking to hook a later part of the update process, see MidUpdateInvasionNet.
Definition at line 148 of file ModHooks.cs.
|
virtual |
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
layers | The layers. |
Definition at line 172 of file ModHooks.cs.
|
virtual |
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
scale | Brightness scale |
Definition at line 187 of file ModHooks.cs.
|
virtual |
Allows you to modify color of light the sun emits.
tileColor | Tile lighting color |
backgroundColor | Background lighting color |
Definition at line 180 of file ModHooks.cs.
|
virtual |
Allows you to set the transformation of the screen that is drawn. (Translations, rotations, scales, etc.)
Definition at line 68 of file ModHooks.cs.
int Terraria.ModLoader.Mod.MountType | ( | string | name | ) |
Gets the ID of the ModMountData instance corresponding to the given name. Returns 0 if no ModMountData has the given name.
name | The name. |
int Terraria.ModLoader.Mod.MountType< T > | ( | ) |
Same as the other MountType, but assumes that the class name and internal name are the same.
T |
T | : | ModMountData | |
T | : | ModContent.MountType<T>() |
bool Terraria.ModLoader.Mod.MusicExists | ( | string | name | ) |
Shorthand for calling ModLoader.MusicExists(this.FileName(name)).
name | The name. |
Referenced by Terraria.ModLoader.ModContent.MusicExists().
int Terraria.ModLoader.Mod.NPCType | ( | string | name | ) |
int Terraria.ModLoader.Mod.NPCType< T > | ( | ) |
Same as the other NPCType, but assumes that the class name and internal name are the same.
T |
T | : | ModNPC | |
T | : | ModContent.NPCType<T>() |
|
virtual |
|
virtual |
Called while the fullscreen map is active. Allows custom drawing to the map.
mouseText | The mouse text. |
Definition at line 203 of file ModHooks.cs.
|
virtual |
Called after interface is drawn but right before mouse and mouse hover text is drawn. Allows for drawing interface.
Note: This hook should no longer be used. It is better to use the ModifyInterfaceLayers hook.
spriteBatch | The sprite batch. |
Definition at line 196 of file ModHooks.cs.
|
virtual |
|
virtual |
Called after the Network got updated, this is the last hook that happens in an update.
If you are looking to hook an earlier part of the update process, see MidUpdateInvasionNet.
Definition at line 165 of file ModHooks.cs.
|
virtual |
Called after the input keys are polled. Allows for modifying things like scroll wheel if your custom drawing should capture that.
Definition at line 209 of file ModHooks.cs.
byte Terraria.ModLoader.Mod.PrefixType | ( | string | name | ) |
Gets the internal ID / type of the ModPrefix corresponding to the name. Returns 0 if no ModPrefix with the given name is found.
name | The name. |
Referenced by Terraria.ModLoader.IO.ItemIO.Load().
byte Terraria.ModLoader.Mod.PrefixType< T > | ( | ) |
Same as the other PrefixType, but assumes that the class name and internal name are the same.
T |
T | : | ModPrefix | |
T | : | ModContent.PrefixType<T>() |
|
virtual |
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.
Definition at line 215 of file ModHooks.cs.
|
virtual |
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.
When Main.autoPause is true or Main.FrameSkipMode is 0 or 2, the game may do a partial update. This means that it only updates menus and some animations, but not the World or Entities. This hook - and every hook after it - only gets called on frames with a full update.
If you are looking to hook a later part of the update process, see MidUpdatePlayerNPC.
Definition at line 85 of file ModHooks.cs.
int Terraria.ModLoader.Mod.ProjectileType | ( | string | name | ) |
Gets the type of the ModProjectile of this mod with the given name. Returns 0 if no ModProjectile with the given name is found.
name | The name. |
int Terraria.ModLoader.Mod.ProjectileType< T > | ( | ) |
Same as the other ProjectileType, but assumes that the class name and internal name are the same.
T |
T | : | ModProjectile | |
T | : | ModContent.ProjectileType<T>() |
ModHotKey Terraria.ModLoader.Mod.RegisterHotKey | ( | string | name, |
string | defaultKey | ||
) |
Registers a hotkey with a name and defaultKey. Use the returned ModHotKey to detect when buttons are pressed. Do this in a ModPlayer.ProcessTriggers.
name | The name. |
defaultKey | The default key. |
Definition at line 1527 of file Mod.cs.
bool Terraria.ModLoader.Mod.SoundExists | ( | string | name | ) |
Shorthand for calling ModLoader.SoundExists(this.FileName(name)).
name | The name. |
Referenced by Terraria.ModLoader.ModContent.SoundExists().
bool Terraria.ModLoader.Mod.TextureExists | ( | string | name | ) |
Shorthand for calling ModLoader.TextureExists(this.FileName(name)).
name | The name. |
Referenced by Terraria.ModLoader.Mod.AddTexture(), and Terraria.ModLoader.ModContent.TextureExists().
int Terraria.ModLoader.Mod.TileEntityType | ( | string | name | ) |
Gets the type of the ModTileEntity of this mod with the given name. Returns -1 if no ModTileEntity with the given name is found.
name | The name. |
int Terraria.ModLoader.Mod.TileEntityType< T > | ( | ) |
Same as the other TileEntityType, but assumes that the class name and internal name are the same.
T |
T | : | ModTileEntity | |
T | : | ModContent.TileEntityType<T>() |
int Terraria.ModLoader.Mod.TileType | ( | string | name | ) |
Gets the type of the ModTile of this mod with the given name. Returns 0 if no ModTile with the given name is found.
name | The name. |
Referenced by Terraria.ModLoader.ModRecipe.AddTile().
int Terraria.ModLoader.Mod.TileType< T > | ( | ) |
Same as the other TileType, but assumes that the class name and internal name are the same.
T |
T | : | ModTile | |
T | : | ModContent.TileType<T>() |
|
virtual |
This is called whenever this mod is unloaded from the game. Use it to undo changes that you've made in Load that aren't automatically handled (for example, modifying the texture of a vanilla item). Mods are guaranteed to be unloaded in the reverse order they were loaded in.
Definition at line 83 of file Mod.cs.
|
virtual |
A legacy hook that you should no longer use. Use the version with two parameters instead.
music |
Definition at line 29 of file ModHooks.cs.
|
virtual |
Allows you to determine what music should currently play.
music | The music. |
priority | The music priority. |
Definition at line 20 of file ModHooks.cs.
References Terraria.ModLoader.Mod.UpdateMusic().
Referenced by Terraria.ModLoader.Mod.UpdateMusic().
|
virtual |
Ran every update and suitable for calling Update for UserInterface classes
Definition at line 74 of file ModHooks.cs.
int Terraria.ModLoader.Mod.WallType | ( | string | name | ) |
int Terraria.ModLoader.Mod.WallType< T > | ( | ) |
Same as the other WallType, but assumes that the class name and internal name are the same.
T |
T | : | ModWall | |
T | : | ModContent.WallType<T>() |
|
private |
Definition at line 26 of file ModInternals.cs.
Referenced by Terraria.ModLoader.Mod.LoadTexture().
|
private |
Definition at line 65 of file Mod.cs.
Referenced by Terraria.ModLoader.Mod.Close(), and Terraria.ModLoader.Mod.LoadResources().
|
getset |
|
getset |
The display name of this mod in the Mods menu.
Definition at line 60 of file Mod.cs.
Referenced by Terraria.ModLoader.ModNPC.AutoStaticDefaults().
|
get |
The amount of extra buff slots this mod desires for Players. This value is checked after Mod.Load but before Mod.PostSetupContent. The actual number of buffs the player can use will be 22 plus the max value of all enabled mods. In-game use Player.MaxBuffs to check the maximum number of buffs.
Definition at line 89 of file Mod.cs.
|
getset |
|
get |
Stores the name of the mod. This name serves as the mod's identification, and also helps with saving everything your mod adds. By default this returns the name of the folder that contains all your code and stuff.
Definition at line 42 of file Mod.cs.
Referenced by Terraria.ModLoader.Exceptions.CustomModDataException.CustomModDataException(), Terraria.ModLoader.Mod.AddBuff(), Terraria.ModLoader.Mod.AddGlobalItem(), Terraria.ModLoader.Mod.AddGlobalNPC(), Terraria.ModLoader.Mod.AddGlobalProjectile(), Terraria.ModLoader.Mod.AddItem(), Terraria.ModLoader.Mod.AddNPC(), Terraria.ModLoader.Mod.AddPrefix(), Terraria.ModLoader.Mod.AddProjectile(), Terraria.ModLoader.Mod.AutoloadBackgrounds(), Terraria.ModLoader.Mod.AutoloadGores(), Terraria.ModLoader.Mod.AutoloadSounds(), Terraria.ModLoader.ModTile.CreateMapEntryName(), Terraria.ModLoader.ModWall.CreateMapEntryName(), Terraria.ModLoader.Mod.GetPacket(), Terraria.ModLoader.Mod.LoadMusic(), Terraria.ModLoader.Mod.LoadResource(), Terraria.ModLoader.IO.ItemIO.Save(), and Terraria.ModLoader.PlayerHooks.SendCustomBiomes().
|
getprotected set |
Definition at line 52 of file Mod.cs.
Referenced by Terraria.ModLoader.GlobalBuff.Autoload(), Terraria.ModLoader.GlobalItem.Autoload(), Terraria.ModLoader.GlobalNPC.Autoload(), Terraria.ModLoader.GlobalProjectile.Autoload(), Terraria.ModLoader.GlobalRecipe.Autoload(), Terraria.ModLoader.GlobalTile.Autoload(), Terraria.ModLoader.GlobalWall.Autoload(), Terraria.ModLoader.ModUgBgStyle.Autoload(), Terraria.ModLoader.ModSurfaceBgStyle.Autoload(), Terraria.ModLoader.GlobalBgStyle.Autoload(), Terraria.ModLoader.ModItem.Autoload(), Terraria.ModLoader.ModNPC.Autoload(), Terraria.ModLoader.ModPlayer.Autoload(), Terraria.ModLoader.ModPrefix.Autoload(), Terraria.ModLoader.ModProjectile.Autoload(), Terraria.ModLoader.ModTileEntity.Autoload(), Terraria.ModLoader.ModWorld.Autoload(), Terraria.ModLoader.ModBuff.Autoload(), Terraria.ModLoader.ModDust.Autoload(), Terraria.ModLoader.ModTile.Autoload(), Terraria.ModLoader.ModWall.Autoload(), Terraria.ModLoader.ModWaterfallStyle.Autoload(), Terraria.ModLoader.ModMountData.Autoload(), and Terraria.ModLoader.ModWaterStyle.Autoload().
|
getset |
|
getset |
The version of tModLoader that was being used when this mod was built.
Definition at line 46 of file Mod.cs.
Referenced by Terraria.ModLoader.Mod.LoadResource().
|
get |
This version number of this mod.
Definition at line 50 of file Mod.cs.
Referenced by Terraria.ModLoader.Mod.LoadResource().