tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
Tile Entities are Entities tightly coupled with tiles, allowing the possibility of tiles to exhibit cool behavior. TileEntity.Update is called in SP and on Server, not on Clients. More...
Public Member Functions | |
virtual bool | Autoload (ref string name) |
Allows you to automatically load a tile entity instead of using Mod.AddTileEntity. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload, or change the default display name. More... | |
int | Find (int i, int j) |
Returns the entity ID of this kind of tile entity at the given coordinates for you. More... | |
virtual int | Hook_AfterPlacement (int i, int j, int type, int style, int direction) |
This method does not get called by tModLoader, and is only included for you convenience so you do not have to cast the result of Mod.GetTileEntity. More... | |
void | Kill (int i, int j) |
A helper method that removes this kind of tile entity from the given coordinates for you. More... | |
virtual void | Load (TagCompound tag) |
Allows you to load the custom data you have saved for this tile entity. More... | |
virtual void | NetReceive (BinaryReader reader, bool lightReceive) |
Receives the data sent in the NetSend hook. Called on MP Client when receiving tile data (!lightReceive) and when a MessageID.TileEntitySharing message is sent (lightReceive) More... | |
virtual void | NetSend (BinaryWriter writer, bool lightSend) |
Allows you to send custom data for this tile entity between client and server. This is called on the server while sending tile data (!lightSend) and when a MessageID.TileEntitySharing message is sent (lightSend) More... | |
virtual void | OnKill () |
This method only gets called in the Kill method. If you plan to use that, you can put code here to make things happen when it is called. More... | |
virtual void | OnNetPlace () |
Code that should be run when this tile entity is placed by means of server-syncing. Called on Server only. More... | |
int | Place (int i, int j) |
A helper method that places this kind of tile entity in the given coordinates for you. More... | |
virtual void | PostGlobalUpdate () |
Code that should be run after all tile entities in the world update. More... | |
virtual void | PreGlobalUpdate () |
Code that should be run before all tile entities in the world update. More... | |
sealed override void | ReadExtraData (BinaryReader reader, bool networkSend) |
Don't use this. It is included only for completion's sake. More... | |
virtual TagCompound | Save () |
Allows you to save custom data for this tile entity. More... | |
abstract bool | ValidTile (int i, int j) |
Whether or not this tile entity is allowed to survive at the given coordinates. You should check whether the tile is active, as well as the tile's type and frame. More... | |
sealed override void | WriteExtraData (BinaryWriter writer, bool networkSend) |
Don't use this. It is included only for completion's sake. More... | |
Static Public Member Functions | |
static ModTileEntity | ConstructFromBase (ModTileEntity tileEntity) |
Returns a new ModTileEntity with the same class, mod, name, and type as the parameter. It is very rare that you should have to use this. More... | |
static ModTileEntity | ConstructFromType (int type) |
Returns a new ModTileEntity with the same class, mod, name, and type as the ModTileEntity with the given type. It is very rare that you should have to use this. More... | |
static int | CountInWorld () |
Returns the number of modded tile entities that exist in the world currently being played. More... | |
static ModTileEntity | GetTileEntity (int type) |
Gets the base ModTileEntity object with the given type. More... | |
static void | Initialize () |
You should never use this. It is only included here for completion's sake. More... | |
static void | NetPlaceEntity (int i, int j, int type) |
You should never use this. It is only included here for completion's sake. More... | |
Static Public Attributes | |
const int | numVanilla = 3 |
Properties | |
Mod | mod [get, set] |
The mod that added this ModTileEntity. More... | |
string | Name [get, set] |
The internal name of this ModTileEntity. More... | |
int | Type [get, set] |
The numeric type used to identify this kind of tile entity. More... | |
Static Private Member Functions | |
static void | UpdateEndInternal () |
static void | UpdateStartInternal () |
Static Private Attributes | |
static int | nextTileEntity = numVanilla |
Tile Entities are Entities tightly coupled with tiles, allowing the possibility of tiles to exhibit cool behavior. TileEntity.Update is called in SP and on Server, not on Clients.
Definition at line 13 of file ModTileEntity.cs.
|
virtual |
Allows you to automatically load a tile entity instead of using Mod.AddTileEntity. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload, or change the default display name.
Definition at line 199 of file ModTileEntity.cs.
References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.ModTileEntity.mod, and Terraria.ModLoader.Mod.Properties.
Referenced by Terraria.ModLoader.Mod.AutoloadTileEntity().
|
static |
Returns a new ModTileEntity with the same class, mod, name, and type as the parameter. It is very rare that you should have to use this.
Definition at line 132 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.mod, Terraria.ModLoader.ModTileEntity.Name, and Terraria.ModLoader.ModTileEntity.Type.
Referenced by Terraria.ModLoader.ModTileEntity.ConstructFromType(), and Terraria.ModLoader.ModTileEntity.Place().
|
static |
Returns a new ModTileEntity with the same class, mod, name, and type as the ModTileEntity with the given type. It is very rare that you should have to use this.
Definition at line 121 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.ConstructFromBase(), and Terraria.ModLoader.ModTileEntity.GetTileEntity().
|
static |
Returns the number of modded tile entities that exist in the world currently being played.
Definition at line 70 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.numVanilla.
int Terraria.ModLoader.ModTileEntity.Find | ( | int | i, |
int | j | ||
) |
Returns the entity ID of this kind of tile entity at the given coordinates for you.
Definition at line 171 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.Type.
|
static |
Gets the base ModTileEntity object with the given type.
Definition at line 58 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.nextTileEntity, and Terraria.ModLoader.ModTileEntity.numVanilla.
Referenced by Terraria.ModLoader.ModTileEntity.ConstructFromType(), and Terraria.ModLoader.ModTileEntity.NetPlaceEntity().
|
virtual |
This method does not get called by tModLoader, and is only included for you convenience so you do not have to cast the result of Mod.GetTileEntity.
Definition at line 241 of file ModTileEntity.cs.
|
static |
You should never use this. It is only included here for completion's sake.
Definition at line 83 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.NetPlaceEntity(), Terraria.ModLoader.ModTileEntity.UpdateEndInternal(), and Terraria.ModLoader.ModTileEntity.UpdateStartInternal().
void Terraria.ModLoader.ModTileEntity.Kill | ( | int | i, |
int | j | ||
) |
A helper method that removes this kind of tile entity from the given coordinates for you.
Definition at line 156 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.OnKill(), and Terraria.ModLoader.ModTileEntity.Type.
|
virtual |
Allows you to load the custom data you have saved for this tile entity.
Definition at line 214 of file ModTileEntity.cs.
|
static |
You should never use this. It is only included here for completion's sake.
Definition at line 104 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.GetTileEntity(), Terraria.ModLoader.ModTileEntity.OnNetPlace(), Terraria.ModLoader.ModTileEntity.Place(), and Terraria.ModLoader.ModTileEntity.ValidTile().
Referenced by Terraria.ModLoader.ModTileEntity.Initialize().
|
virtual |
Receives the data sent in the NetSend hook. Called on MP Client when receiving tile data (!lightReceive) and when a MessageID.TileEntitySharing message is sent (lightReceive)
reader | The reader. |
lightReceive | If true, read only data that can change. Otherwise, read the full information. |
Definition at line 230 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.ReadExtraData().
|
virtual |
Allows you to send custom data for this tile entity between client and server. This is called on the server while sending tile data (!lightSend) and when a MessageID.TileEntitySharing message is sent (lightSend)
writer | The writer. |
lightSend | If true, send only data that can change. Otherwise, send the full information. |
Definition at line 222 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.WriteExtraData().
|
virtual |
This method only gets called in the Kill method. If you plan to use that, you can put code here to make things happen when it is called.
Definition at line 266 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.Kill().
|
virtual |
Code that should be run when this tile entity is placed by means of server-syncing. Called on Server only.
Definition at line 248 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.NetPlaceEntity().
int Terraria.ModLoader.ModTileEntity.Place | ( | int | i, |
int | j | ||
) |
A helper method that places this kind of tile entity in the given coordinates for you.
Definition at line 143 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.ConstructFromBase(), and Terraria.ModLoader.ModTileEntity.Type.
Referenced by Terraria.ModLoader.ModTileEntity.NetPlaceEntity().
|
virtual |
Code that should be run after all tile entities in the world update.
Definition at line 260 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.UpdateEndInternal().
|
virtual |
Code that should be run before all tile entities in the world update.
Definition at line 254 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.UpdateStartInternal().
sealed override void Terraria.ModLoader.ModTileEntity.ReadExtraData | ( | BinaryReader | reader, |
bool | networkSend | ||
) |
Don't use this. It is included only for completion's sake.
Definition at line 192 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.NetReceive().
|
virtual |
Allows you to save custom data for this tile entity.
Definition at line 207 of file ModTileEntity.cs.
|
staticprivate |
Definition at line 95 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.PostGlobalUpdate().
Referenced by Terraria.ModLoader.ModTileEntity.Initialize().
|
staticprivate |
Definition at line 89 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.PreGlobalUpdate().
Referenced by Terraria.ModLoader.ModTileEntity.Initialize().
|
pure virtual |
Whether or not this tile entity is allowed to survive at the given coordinates. You should check whether the tile is active, as well as the tile's type and frame.
Referenced by Terraria.ModLoader.ModTileEntity.NetPlaceEntity().
sealed override void Terraria.ModLoader.ModTileEntity.WriteExtraData | ( | BinaryWriter | writer, |
bool | networkSend | ||
) |
Don't use this. It is included only for completion's sake.
Definition at line 185 of file ModTileEntity.cs.
References Terraria.ModLoader.ModTileEntity.NetSend().
|
staticprivate |
Definition at line 16 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.GetTileEntity().
|
static |
Definition at line 15 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.CountInWorld(), and Terraria.ModLoader.ModTileEntity.GetTileEntity().
|
getset |
The mod that added this ModTileEntity.
Definition at line 23 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.Autoload(), and Terraria.ModLoader.ModTileEntity.ConstructFromBase().
|
getset |
The internal name of this ModTileEntity.
Definition at line 31 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.Mod.AutoloadTileEntity(), and Terraria.ModLoader.ModTileEntity.ConstructFromBase().
|
getset |
The numeric type used to identify this kind of tile entity.
Definition at line 39 of file ModTileEntity.cs.
Referenced by Terraria.ModLoader.ModTileEntity.ConstructFromBase(), Terraria.ModLoader.ModTileEntity.Find(), Terraria.ModLoader.ModTileEntity.Kill(), and Terraria.ModLoader.ModTileEntity.Place().