#include <BlockEntity.h>
Definition at line 40 of file BlockEntity.h.
virtual cBlockEntity::~cBlockEntity |
( |
| ) |
|
|
inlinevirtual |
Makes an exact copy of this block entity, except for its m_World (set to nullptr), and at a new position.
Uses CopyFrom() to copy the properties.
Definition at line 114 of file BlockEntity.cpp.
Copies all properties of a_Src into this entity, except for its m_World and location.
Each non-abstract descendant should override to copy its specific properties, and call Super::CopyFrom(a_Src) to copy the common ones.
Reimplemented in cMobHeadEntity, cNoteEntity, cHopperEntity, cBrewingstandEntity, cDropSpenserEntity, cFlowerPotEntity, cFurnaceEntity, cJukeboxEntity, cBlockEntityWithItems, cSignEntity, cChestEntity, cBedEntity, cCommandBlockEntity, cBeaconEntity, and cMobSpawnerEntity.
Definition at line 125 of file BlockEntity.cpp.
Creates a new block entity for the specified block type at the specified absolute pos.
If a_World is valid, then the entity is created bound to that world Returns nullptr for unknown block types.
Definition at line 76 of file BlockEntity.cpp.
virtual void cBlockEntity::Destroy |
( |
void |
| ) |
|
|
inlinevirtual |
BLOCKTYPE cBlockEntity::GetBlockType |
( |
| ) |
const |
|
inline |
int cBlockEntity::GetChunkX |
( |
| ) |
const |
|
inline |
int cBlockEntity::GetChunkZ |
( |
| ) |
const |
|
inline |
virtual const char* cBlockEntity::GetClass |
( |
| ) |
const |
|
inlinevirtual |
Returns the name of the topmost class (the most descendant).
Used for Lua bindings to push the correct object type.
Definition at line 96 of file BlockEntity.h.
static const char* cBlockEntity::GetClassStatic |
( |
void |
| ) |
|
|
inlinestatic |
virtual const char* cBlockEntity::GetParentClass |
( |
| ) |
const |
|
inlinevirtual |
Returns the name of the parent class, or empty string if no parent class.
Definition at line 99 of file BlockEntity.h.
int cBlockEntity::GetPosX |
( |
| ) |
const |
|
inline |
int cBlockEntity::GetPosY |
( |
| ) |
const |
|
inline |
int cBlockEntity::GetPosZ |
( |
| ) |
const |
|
inline |
Vector3i cBlockEntity::GetRelPos |
( |
| ) |
const |
|
inline |
int cBlockEntity::GetRelX |
( |
| ) |
const |
|
inline |
int cBlockEntity::GetRelZ |
( |
| ) |
const |
|
inline |
cWorld* cBlockEntity::GetWorld |
( |
| ) |
const |
|
inline |
virtual bool cBlockEntity::IsA |
( |
const char * |
a_ClassName | ) |
const |
|
inlinevirtual |
Returns true if the object is the specified class, or its descendant.
Definition at line 93 of file BlockEntity.h.
bool cBlockEntity::IsBlockEntityBlockType |
( |
BLOCKTYPE |
a_BlockType | ) |
|
|
static |
Returns true if the specified blocktype is supposed to have an associated block entity.
Definition at line 39 of file BlockEntity.cpp.
Sends the packet defining the block entity to the client specified.
To send to all eligible clients, use cWorld::BroadcastBlockEntity()
Implemented in cMobHeadEntity, cNoteEntity, cHopperEntity, cBrewingstandEntity, cDropSpenserEntity, cFlowerPotEntity, cFurnaceEntity, cJukeboxEntity, cSignEntity, cChestEntity, cBedEntity, cCommandBlockEntity, cBeaconEntity, cMobSpawnerEntity, and cEnderChestEntity.
void cBlockEntity::SetPos |
( |
Vector3i |
a_NewPos | ) |
|
Updates the internally stored position.
Note that this should not ever be used for world-contained block entities, it is meant only for when BEs in a cBlockArea are manipulated. Asserts that the block entity is not assigned to a world.
Definition at line 29 of file BlockEntity.cpp.
void cBlockEntity::SetWorld |
( |
cWorld * |
a_World | ) |
|
|
inline |
virtual bool cBlockEntity::Tick |
( |
std::chrono::milliseconds |
a_Dt, |
|
|
cChunk & |
a_Chunk |
|
) |
| |
|
inlinevirtual |
virtual bool cBlockEntity::UsedBy |
( |
cPlayer * |
a_Player | ) |
|
|
pure virtual |
Called when a player uses this entity; should open the UI window.
returns true if the use was successful, return false to use the block as a "normal" block
Implemented in cMobHeadEntity, cHopperEntity, cNoteEntity, cBrewingstandEntity, cDropSpenserEntity, cFurnaceEntity, cFlowerPotEntity, cJukeboxEntity, cSignEntity, cChestEntity, cBedEntity, cCommandBlockEntity, cBeaconEntity, cMobSpawnerEntity, and cEnderChestEntity.
The block meta representing this particular instance in the world Mainly used for directional entities, such as dispensers.
Definition at line 153 of file BlockEntity.h.
The blocktype representing this particular instance in the world.
Mainly used for multi-block-type entities, such as furnaces / lit furnaces.
Definition at line 149 of file BlockEntity.h.
Position in absolute block coordinates.
Definition at line 142 of file BlockEntity.h.
Position relative to the chunk, used to speed up ticking.
Definition at line 145 of file BlockEntity.h.
The documentation for this class was generated from the following files: