tModLoader v2024.09
A mod to make and play Terraria mods
TEHatRack Class Reference

Inherits TileEntity, and IFixLoadedData.

Public Member Functions

bool ContainsItems ()
 
void Draw (int tileLeftX, int tileTopY)
 
void FixLoadedData ()
 
override TileEntity GenerateInstance ()
 
override string GetItemGamepadInstructions (int slot=0)
 
override bool IsTileValidForEntity (int x, int y)
 
override void LoadData (TagCompound tag)
 Allows you to load custom data that you have saved for this tile entity.
Try to write defensive loading code that won't crash if something's missing. More...
 
override void NetPlaceEntityAttempt (int x, int y)
 
override void NetReceive (BinaryReader reader)
 Receives custom data sent in the NetSend hook.
Called while receiving tile data (!lightReceive) and when MessageID.TileEntitySharing is received (lightReceive).
Only called on the client. More...
 
override void NetSend (BinaryWriter writer)
 Allows you to send custom data for this tile entity between client and server, which will be handled in NetReceive.
Called while sending tile data (!lightSend) and when MessageID.TileEntitySharing is sent (lightSend).
Only called on the server. More...
 
override void OnInventoryDraw (Player player, SpriteBatch spriteBatch)
 
override void OnPlayerUpdate (Player player)
 
override bool OverrideItemSlotHover (Item[] inv, int context=0, int slot=0)
 
override bool OverrideItemSlotLeftClick (Item[] inv, int context=0, int slot=0)
 
override void ReadExtraData (BinaryReader reader, bool networkSend)
 
void ReadItem (int itemIndex, BinaryReader reader, bool dye)
 
override void RegisterTileEntityID (int assignedID)
 
override void SaveData (TagCompound tag)
 Allows you to save custom data for this tile entity.

NOTE: The provided tag is always empty by default, and is provided as an argument only for the sake of convenience and optimization.
NOTE: Try to only save data that isn't default values. More...
 
override string ToString ()
 
override bool TryGetItemGamepadOverrideInstructions (Item[] inv, int context, int slot, out string instruction)
 
override void WriteExtraData (BinaryWriter writer, bool networkSend)
 
void WriteItem (int itemIndex, BinaryWriter writer, bool dye)
 
- Public Member Functions inherited from TileEntity
virtual TileEntity GenerateInstance ()
 
virtual string GetItemGamepadInstructions (int slot=0)
 
virtual bool IsTileValidForEntity (int x, int y)
 
virtual void LoadData (TagCompound tag)
 Allows you to load custom data that you have saved for this tile entity.
Try to write defensive loading code that won't crash if something's missing. More...
 
virtual void NetPlaceEntityAttempt (int x, int y)
 
virtual void NetReceive (BinaryReader reader)
 Receives custom data sent in the NetSend hook.
Called while receiving tile data (!lightReceive) and when MessageID.TileEntitySharing is received (lightReceive).
Only called on the client. More...
 
virtual void NetSend (BinaryWriter writer)
 Allows you to send custom data for this tile entity between client and server, which will be handled in NetReceive.
Called while sending tile data (!lightSend) and when MessageID.TileEntitySharing is sent (lightSend).
Only called on the server. 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 void SaveData (TagCompound tag)
 Allows you to save custom data for this tile entity.

NOTE: The provided tag is always empty by default, and is provided as an argument only for the sake of convenience and optimization.
NOTE: Try to only save data that isn't default values. 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 Find (int x, int y)
 
static bool FitsHatRack (Item item)
 
static void Framing_CheckTile (int callX, int callY)
 
static int Hook_AfterPlacement (int x, int y, int type=475, int style=0, int direction=1, int alternate=0)
 
static bool IsBreakable (int clickX, int clickY)
 
static void Kill (int x, int y)
 
static void OnPlayerInteraction (Player player, int clickX, int clickY)
 
static int Place (int x, int y)
 
- Static Public Member Functions inherited from TileEntity
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)
 

Additional Inherited Members

- Public Attributes inherited from TileEntity
int ID
 A unique ID for each TileEntity instance in the world.
 
Point16 Position
 The tile coordinate location of this TileEntity. Will typically be the top left corner of the corresponding multitile, but not necessarily.
 
byte type
 
- Static Public Attributes inherited from TileEntity
static Dictionary< int, TileEntityByID = new Dictionary<int, TileEntity>()
 Maps ID to TileEntity instances.
 
static Dictionary< Point16, TileEntityByPosition = new Dictionary<Point16, TileEntity>()
 Maps tile coordinate locations to the TileEntity at that location.
 
static object EntityCreationLock = new object()
 
static TileEntitiesManager manager
 
const int MaxEntitiesPerChunk = 1000
 
static int TileEntitiesNextID
 
- Events inherited from TileEntity
static Action _UpdateEnd
 
static Action _UpdateStart
 

Member Function Documentation

◆ GenerateInstance()

override TileEntity TEHatRack.GenerateInstance ( )
virtual

Reimplemented from TileEntity.

◆ GetItemGamepadInstructions()

override string TEHatRack.GetItemGamepadInstructions ( int  slot = 0)
virtual

Reimplemented from TileEntity.

◆ IsTileValidForEntity()

override bool TEHatRack.IsTileValidForEntity ( int  x,
int  y 
)
virtual

Reimplemented from TileEntity.

◆ LoadData()

override void TEHatRack.LoadData ( TagCompound  tag)
virtual

Allows you to load custom data that you have saved for this tile entity.
Try to write defensive loading code that won't crash if something's missing.

Parameters
tagThe TagCompound to load data from.

Reimplemented from TileEntity.

◆ NetPlaceEntityAttempt()

override void TEHatRack.NetPlaceEntityAttempt ( int  x,
int  y 
)
virtual

Reimplemented from TileEntity.

◆ NetReceive()

override void TEHatRack.NetReceive ( BinaryReader  reader)
virtual

Receives custom data sent in the NetSend hook.
Called while receiving tile data (!lightReceive) and when MessageID.TileEntitySharing is received (lightReceive).
Only called on the client.

Parameters
readerThe reader.

Reimplemented from TileEntity.

◆ NetSend()

override void TEHatRack.NetSend ( BinaryWriter  writer)
virtual

Allows you to send custom data for this tile entity between client and server, which will be handled in NetReceive.
Called while sending tile data (!lightSend) and when MessageID.TileEntitySharing is sent (lightSend).
Only called on the server.

Parameters
writerThe writer.

Reimplemented from TileEntity.

◆ OnInventoryDraw()

override void TEHatRack.OnInventoryDraw ( Player  player,
SpriteBatch  spriteBatch 
)
virtual

Reimplemented from TileEntity.

◆ OnPlayerUpdate()

override void TEHatRack.OnPlayerUpdate ( Player  player)
virtual

Reimplemented from TileEntity.

◆ OverrideItemSlotHover()

override bool TEHatRack.OverrideItemSlotHover ( Item[]  inv,
int  context = 0,
int  slot = 0 
)
virtual

Reimplemented from TileEntity.

◆ OverrideItemSlotLeftClick()

override bool TEHatRack.OverrideItemSlotLeftClick ( Item[]  inv,
int  context = 0,
int  slot = 0 
)
virtual

Reimplemented from TileEntity.

◆ ReadExtraData()

override void TEHatRack.ReadExtraData ( BinaryReader  reader,
bool  networkSend 
)
virtual

Reimplemented from TileEntity.

◆ RegisterTileEntityID()

override void TEHatRack.RegisterTileEntityID ( int  assignedID)
virtual

Reimplemented from TileEntity.

◆ SaveData()

override void TEHatRack.SaveData ( TagCompound  tag)
virtual

Allows you to save custom data for this tile entity.

NOTE: The provided tag is always empty by default, and is provided as an argument only for the sake of convenience and optimization.
NOTE: Try to only save data that isn't default values.

Parameters
tagThe TagCompound to save data into. Note that this is always empty by default, and is provided as an argument only for the sake of convenience and optimization.

Reimplemented from TileEntity.

◆ TryGetItemGamepadOverrideInstructions()

override bool TEHatRack.TryGetItemGamepadOverrideInstructions ( Item[]  inv,
int  context,
int  slot,
out string  instruction 
)
virtual

Reimplemented from TileEntity.

◆ WriteExtraData()

override void TEHatRack.WriteExtraData ( BinaryWriter  writer,
bool  networkSend 
)
virtual

Reimplemented from TileEntity.