Inherited by Terraria.ModLoader.Default.ModLoaderMod.
|
int | AddBossHeadTexture (string texture, int npcType=-1) |
| Assigns a head texture that can be used by NPCs on the map. More...
|
|
void | AddConfig (string name, ModConfig mc) |
|
void | AddContent (ILoadable instance) |
|
void | AddContent< T > () |
|
int | AddEquipTexture (EquipTexture equipTexture, ModItem item, EquipType type, string texture) |
| 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 texture) |
| 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...
|
|
int | AddNPCHeadTexture (int npcType, string texture) |
| Assigns a head texture to the given town NPC type. 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 Recipe, since it provides methods that simplify recipe creation. 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.
The Expert Cross Mod Content Guideexplains how to use this hook to implement and utilize cross-mod capabilities. More...
|
|
Recipe | CloneRecipe (Recipe recipe) |
| Creates a clone of the provided recipe except the source mod of the Recipe will be this Mod. The clone will have to registered after being tweaked. 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...
|
|
virtual IContentSource | CreateDefaultContentSource () |
|
Recipe | CreateRecipe (int result, int amount=1) |
|
bool | FileExists (string name) |
|
T | Find< T > (string name) |
| Attempts to find the content instance from this mod with the specified name. Caching the result is recommended.This will throw exceptions on failure. More...
|
|
sbyte | GetAccessorySlot (string name, EquipType type) |
| Same as GetEquipSlot, except returns the number as an sbyte (signed byte) for your convenience. More...
|
|
ModConfig | GetConfig (string name) |
|
IEnumerable< ILoadable > | GetContent () |
|
IEnumerable< T > | GetContent< T > () |
|
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...
|
|
List< string > | GetFileNames () |
| Retrieves the names of every file packaged into this mod. Note that this includes extensions, and for images the extension will always be .rawimg . More...
|
|
Stream | GetFileStream (string name, bool newFileStream=false) |
| Retrieve contents of files within the tmod file More...
|
|
ModPacket | GetPacket (int capacity=256) |
| Creates a ModPacket object that you can write to and then send between servers and clients. More...
|
|
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...
|
|
bool | HasAsset (string assetName) |
|
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 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 | 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...
|
|
bool | RequestAssetIfExists< T > (string assetName, out Asset< T > asset) |
|
bool | TryFind< T > (string name, out T value) |
| Safely attempts to find the content instance from this mod with the specified name. Caching the result is recommended. 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...
|
|
|
AssetRepository | Assets [get] |
|
bool | BackgroundAutoloadingEnabled = true [get] |
| Whether or not this mod will automatically add images in the Backgrounds folder as background textures to the game. This means you do not need to manually call Mod.AddBackgroundTexture. More...
|
|
Assembly | Code [get, set] |
| The assembly code this is loaded when tModLoader loads this mod. More...
|
|
bool | ContentAutoloadingEnabled = true [get] |
| Whether or not this mod will autoload content by default. Autoloading content means you do not need to manually add content through methods. 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 | GoreAutoloadingEnabled = true [get] |
| Whether or not this mod will automatically add images in the Gores folder as gores to the game, along with any ModGore classes that share names with the images. This means you do not need to manually call Mod.AddGore. More...
|
|
bool | IsNetSynced [get] |
|
ILog | Logger [get, set] |
| A logger with this mod's name for easy logging. More...
|
|
bool | MusicAutoloadingEnabled = true [get] |
| Whether or not this mod will automatically add music in the Sounds folder to the game. Place music tracks in Sounds/Music to autoload them. 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...
|
|
short | NetID [get] |
|
IContentSource | RootContentSource [get] |
|
ModSide | Side [get, set] |
| The ModSide that controls how this mod is synced between client and server. More...
|
|
bool | SoundAutoloadingEnabled = true [get] |
| Whether or not this mod will automatically add sounds in the Sounds folder to the game. Place sounds in Sounds/Item to autoload them as item sounds, Sounds/NPCHit to add them as npcHit sounds, and Sounds/NPCKilled to add them as npcKilled sounds. Sounds placed anywhere else in the Sounds folder will be added as custom sounds. Any ModSound classes that share the same name as the sound files will be bound to them. Setting this field to true means that you do not need to manually call AddSound. 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...
|
|
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.