5 #include "../Simulator/RedstoneSimulator.h" 85 (Window ==
nullptr) &&
86 (m_Neighbour !=
nullptr)
93 if (Window !=
nullptr)
int m_NumActivePlayers
Number of players who currently have this chest open.
void DestroyWindow()
Forces any players to close the owned window.
cBlockEntityWithItems(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, int a_ItemGridWidth, int a_ItemGridHeight, cWorld *a_World)
cChestEntity * m_Neighbour
Neighbouring chest that links to form a double chest.
unsigned char BLOCKTYPE
The datatype used by blockdata.
bool DoWithChunkAt(Vector3i a_BlockPos, cChunkCallback a_Callback)
Calls the callback for the chunk at the block position specified, with ChunkMapCS locked...
void SetNumberOfPlayers(int a_NumActivePlayers)
Sets the number of players who currently have this chest open.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
int GetNumberOfPlayers(void) const
Gets the number of players who currently have this chest open.
void MarkChunkDirty(int a_ChunkX, int a_ChunkZ)
cWindow * GetWindow(void) const
virtual void OnSlotChanged(cItemGrid *a_Grid, int a_SlotNum) override
cItemGrid::cListener overrides:
void OpenNewWindow()
Opens a new chest window where this is the primary chest and any neighbour is the secondary...
void ScanNeighbours()
Search horizontally adjacent blocks for neighbouring chests of the same type and links them together...
void WakeUp(Vector3i a_Block, cChunk *a_Chunk)
Called when a block changes.
Vector3i m_Pos
Position in absolute block coordinates.
#define BLOCKENTITY_PROTODEF(classname)
Place this macro in the declaration of each cBlockEntity descendant.
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
cRedstoneSimulator * GetRedstoneSimulator(void)
bool IsBlocked()
Returns true if the chest should not be accessible by players.
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
void BroadcastWholeWindow(void)
Sends the contents of the whole window to all clients of this window.