Inherited by ModTileEntity, TEDisplayDoll, TEFoodPlatter, TEHatRack, TEItemFrame, TELogicSensor, TETeleportationPylon, TETrainingDummy, and TEWeaponsRack.
|
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). Note that this is called on a new instance that will replace the existing instance at the Position, if any. ID is not necessarily assigned yet when this is called. 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 () |
| Allows logic to execute every game update for this placed Tile Entity. Called on each placed Tile Entity. This hook is not called for multiplayer clients. The ID.MessageID.TileEntitySharing network message will need be used to keep clients in sync if necessary. More...
|
|
virtual void | WriteExtraData (BinaryWriter writer, bool networkSend) |
|
|
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 bool | TryGet< T > (int i, int j, out T entity) |
| Attempts to retrieve the TileEntity at the given coordinates of the specified Type (T ). Works with any provided coordinate belonging to the multitile. Note that this method assumes the TileEntity is placed in the top left corner of the multitile. More...
|
|
static bool | TryGet< T > (Point16 point, out T entity) |
|
static void | UpdateEnd () |
|
static void | UpdateStart () |
|
static void | Write (BinaryWriter writer, TileEntity ent, bool networkSend=false, bool lightSend=false) |
|
|
int | ID |
| A unique ID for each TileEntity instance in the world. This ID is consistent in multiplayer.
|
|
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 Action | _UpdateEnd |
|
static Action | _UpdateStart |
|
◆ IsTileValidForEntity()
virtual bool TileEntity.IsTileValidForEntity |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
virtual |
◆ LoadData()
◆ NetPlaceEntityAttempt()
virtual void TileEntity.NetPlaceEntityAttempt |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
virtual |
◆ NetReceive()
virtual void TileEntity.NetReceive |
( |
BinaryReader |
reader | ) |
|
|
virtual |
◆ NetSend()
virtual void TileEntity.NetSend |
( |
BinaryWriter |
writer | ) |
|
|
virtual |
◆ ReadExtraData()
virtual void TileEntity.ReadExtraData |
( |
BinaryReader |
reader, |
|
|
bool |
networkSend |
|
) |
| |
|
virtual |
◆ SaveData()
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
-
tag | The 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 in TEDisplayDoll, TEFoodPlatter, TEHatRack, TEItemFrame, TEWeaponsRack, and UnloadedTileEntity.
◆ TryGet< T >() [1/2]
static bool TileEntity.TryGet< T > |
( |
int |
i, |
|
|
int |
j, |
|
|
out T |
entity |
|
) |
| |
|
static |
Attempts to retrieve the TileEntity at the given coordinates of the specified Type (T ). Works with any provided coordinate belonging to the multitile. Note that this method assumes the TileEntity is placed in the top left corner of the multitile.
- Template Parameters
-
T | The type to get the entity as |
- Parameters
-
i | The tile X-coordinate |
j | The tile Y-coordinate |
entity | The found T instance, if there was one. |
- Returns
true
if there was a T instance, or false
if there was no entity present OR the entity was not a T instance.
◆ TryGet< T >() [2/2]
static bool TileEntity.TryGet< T > |
( |
Point16 |
point, |
|
|
out T |
entity |
|
) |
| |
|
static |
- Type Constraints
-
T | : | TileEntity | |
T | : | TryGet<T> | |
T | : | point.X | |
T | : | point.Y | |
T | : | out | |
T | : | entity | |
◆ Update()
virtual void TileEntity.Update |
( |
| ) |
|
|
virtual |
Allows logic to execute every game update for this placed Tile Entity. Called on each placed Tile Entity. This hook is not called for multiplayer clients. The ID.MessageID.TileEntitySharing network message will need be used to keep clients in sync if necessary.
Reimplemented in TELogicSensor, and TETrainingDummy.
◆ WriteExtraData()
virtual void TileEntity.WriteExtraData |
( |
BinaryWriter |
writer, |
|
|
bool |
networkSend |
|
) |
| |
|
virtual |