34 virtual bool Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
void SetBeaconLevel(char a_Level)
Modify the beacon level.
bool SetPrimaryEffect(cEntityEffect::eType a_Effect)
Sets the primary effect.
void UpdateBeacon(void)
Update the beacon.
virtual void OnRemoveFromWorld() override
Called when the block entity object is removed from a world.
bool IsActive(void) const
Is the beacon active?
virtual bool Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking.
static bool IsMineralBlock(BLOCKTYPE a_BlockType)
Returns true if the block is a diamond block, a golden block, an iron block or an emerald block.
cEntityEffect::eType GetPrimaryEffect(void) const
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
cEntityEffect::eType m_PrimaryEffect
char CalculatePyramidLevel(void)
Calculate the amount of layers the pyramid below the beacon has.
static bool IsValidEffect(cEntityEffect::eType a_Effect, char a_BeaconLevel)
Returns true if the effect can be used.
void GiveEffects(void)
Give the near-players the effects.
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
bool IsBeaconBlocked(void)
Is the beacon blocked by non-transparent blocks that are higher than the beacon?
cEntityEffect::eType m_SecondaryEffect
char GetBeaconLevel(void) const
Returns the beacon level.
cEntityEffect::eType GetSecondaryEffect(void) const
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
bool SetSecondaryEffect(cEntityEffect::eType a_Effect)
Sets the secondary effect.
cBeaconEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
cBlockEntityWithItems(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, int a_ItemGridWidth, int a_ItemGridHeight, cWorld *a_World)
eType
All types of entity effects (numbers correspond to protocol / storage types)