|
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Go to the documentation of this file.
5 #include "../Simulator/RedstoneSimulator.h"
cChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
cChestEntity * m_Neighbour
Neighbouring chest that links to form a double chest.
void DestroyWindow()
Forces any players to close the owned window.
bool ScanNeighbour(cChunk &a_Chunk, Vector3i a_Position)
Search the given horizontally adjacent relative position for a neighbouring chest of the same type.
virtual void OnRemoveFromWorld() override
Called when the block entity object is removed from a world.
cChestEntity & GetPrimaryChest()
Returns the associated primary chest.
void OpenNewWindow()
Opens a new chest window where this is the primary chest and any neighbour is the secondary.
cChestEntity * GetSecondaryChest()
Returns the associated secondary chest, if any.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
int GetNumberOfPlayers(void) const
Gets the number of players who currently have this chest open.
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
virtual void OnAddToWorld(cWorld &a_World, cChunk &a_Chunk) override
Called when the block entity object is added to a world.
bool IsBlocked()
Returns true if the chest should not be accessible by players.
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
unsigned char BLOCKTYPE
The datatype used by blockdata.
void SetNumberOfPlayers(int a_NumActivePlayers)
Sets the number of players who currently have this chest open.
virtual void OnSlotChanged(cItemGrid *a_Grid, int a_SlotNum) override
cItemGrid::cListener overrides:
cBlockEntityWithItems(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, int a_ItemGridWidth, int a_ItemGridHeight, cWorld *a_World)
int m_NumActivePlayers
Number of players who currently have this chest open.
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.