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