tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.DataStructures.TileEntity Class Reference

Inherited by Terraria.GameContent.Tile_Entities.TELogicSensor, Terraria.GameContent.Tile_Entities.TETeleportationPylon, Terraria.GameContent.Tile_Entities.TETrainingDummy, and Terraria.ModLoader.ModTileEntity.

Public Member Functions

virtual TileEntity GenerateInstance ()
 
virtual string GetItemGamepadInstructions (int slot=0)
 
virtual bool IsTileValidForEntity (int x, int y)
 
virtual void Load (TagCompound tag)
 Allows you to load the custom data you have saved for this tile entity. More...
 
virtual void NetPlaceEntityAttempt (int x, int y)
 
virtual void NetReceive (BinaryReader reader)
 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)
 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 OnInventoryDraw (Player player, SpriteBatch spriteBatch)
 
virtual void OnPlayerUpdate (Player player)
 
virtual bool OverrideItemSlotHover (Item[] inv, int context=0, int slot=0)
 
virtual bool OverrideItemSlotLeftClick (Item[] inv, int context=0, int slot=0)
 
virtual void ReadExtraData (BinaryReader reader, bool networkSend)
 
virtual void RegisterTileEntityID (int assignedID)
 
virtual TagCompound Save ()
 Allows you to save custom data for this tile entity. More...
 
virtual bool TryGetItemGamepadOverrideInstructions (Item[] inv, int context, int slot, out string instruction)
 
virtual void Update ()
 
virtual void WriteExtraData (BinaryWriter writer, bool networkSend)
 

Static Public Member Functions

static int AssignNewID ()
 
static void BasicOpenCloseInteraction (Player player, int x, int y, int id)
 
static void Clear ()
 
static void InitializeAll ()
 
static bool IsOccupied (int id, out int interactingPlayer)
 
static void PlaceEntityNet (int x, int y, int type)
 
static TileEntity Read (BinaryReader reader, bool networkSend=false, bool lightSend=false)
 
static void SetInteractionAnchor (Player player, int x, int y, int id)
 
static void UpdateEnd ()
 
static void UpdateStart ()
 
static void Write (BinaryWriter writer, TileEntity ent, bool networkSend=false, bool lightSend=false)
 

Public Attributes

int ID
 
Point16 Position
 
byte type
 

Static Public Attributes

static Dictionary< int, TileEntityByID = new Dictionary<int, TileEntity>()
 
static Dictionary< Point16, TileEntityByPosition = new Dictionary<Point16, TileEntity>()
 
static object EntityCreationLock = new object()
 
static TileEntitiesManager manager
 
const int MaxEntitiesPerChunk = 1000
 
static int TileEntitiesNextID
 

Events

static Action _UpdateEnd
 
static Action _UpdateStart
 

Member Function Documentation

◆ Load()

virtual void Terraria.DataStructures.TileEntity.Load ( TagCompound  tag)
virtual

Allows you to load the custom data you have saved for this tile entity.

Reimplemented in Terraria.ModLoader.Default.UnloadedTileEntity.

◆ NetReceive()

virtual void Terraria.DataStructures.TileEntity.NetReceive ( BinaryReader  reader)
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)

Parameters
readerThe reader.

Reimplemented in Terraria.ModLoader.ModTileEntity.

◆ NetSend()

virtual void Terraria.DataStructures.TileEntity.NetSend ( BinaryWriter  writer)
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)

Parameters
writerThe writer.

Reimplemented in Terraria.ModLoader.ModTileEntity.

◆ Save()

virtual TagCompound Terraria.DataStructures.TileEntity.Save ( )
virtual

Allows you to save custom data for this tile entity.

Returns

Reimplemented in Terraria.ModLoader.Default.UnloadedTileEntity.