Terraria.ModLoader.ModContent

Manages content added by mods. Liasons between mod content and Terraria's arrays and oversees the Loader classes.

Methods

GetFileBytes(System.String)()
Gets the byte representation of the file with the specified name. The name is in the format of "ModFolder/OtherFolders/FileNameWithExtension". Throws an ArgumentException if the file does not exist.
FileExists(System.String)()
Returns whether or not a file with the specified name exists.
GetTexture(System.String)()
Gets the texture with the specified name. The name is in the format of "ModFolder/OtherFolders/FileNameWithoutExtension". Throws an ArgumentException if the texture does not exist. If a vanilla texture is desired, the format "Terraria/FileNameWithoutExtension" will reference an image from the "terraria/Content/Images" folder. Note: Texture2D is in the Microsoft.Xna.Framework.Graphics namespace.
TextureExists(System.String)()
Returns whether or not a texture with the specified name exists.
GetSound(System.String)()
Gets the sound with the specified name. The name is in the same format as for texture names. Throws an ArgumentException if the sound does not exist. Note: SoundEffect is in the Microsoft.Xna.Framework.Audio namespace.
SoundExists(System.String)()
Returns whether or not a sound with the specified name exists.
GetMusic(System.String)()
Gets the music with the specified name. The name is in the same format as for texture names. Throws an ArgumentException if the music does not exist. Note: SoundMP3 is in the Terraria.ModLoader namespace.
MusicExists(System.String)()
Returns whether or not a sound with the specified name exists.
CleanupModReferences()
Several arrays and other fields hold references to various classes from mods, we need to clean them up to give properly coded mods a chance to be completely free of references so that they can be collected by the garbage collection. For most things eventually they will be replaced during gameplay, but we want the old instance completely gone quickly.