5 #include "../Simulator/RedstoneSimulator.h" 15 int a_ItemGridWidth,
int a_ItemGridHeight,
18 super(a_BlockType, a_BlockMeta, a_Pos, a_World),
20 m_Contents(a_ItemGridWidth, a_ItemGridHeight)
cBlockEntityWithItems(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, int a_ItemGridWidth, int a_ItemGridHeight, cWorld *a_World)
void CopyFrom(const cItemGrid &a_Src)
Copies all items from a_Src to this grid.
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...
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
void CopyToItems(cItems &a_Items) const
Copies the contents into a cItems object; preserves the original a_Items contents.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
virtual void Destroy(void) override
void Clear(void)
Sets all items as empty.
void SpawnItemPickups(const cItems &a_Pickups, Vector3i a_BlockPos, double a_FlyAwaySpeed=1.0, bool a_IsPlayerCreated=false)
Spawns item pickups for each item in the list.
void AddListener(cListener &a_Listener)
Adds a callback that gets called whenever a slot changes.
void MarkChunkDirty(int a_ChunkX, int a_ChunkZ)
cWindow * GetWindow(void) const
void WakeUp(Vector3i a_Block, cChunk *a_Chunk)
Called when a block changes.
Vector3i m_Pos
Position in absolute block coordinates.
virtual void CopyFrom(const cBlockEntity &a_Src)
Copies all properties of a_Src into this entity, except for its m_World and location.
Window owner that is associated with a block entity (chest, furnace, ...)
virtual void OnSlotChanged(cItemGrid *a_Grid, int a_SlotNum) override
Called whenever a slot changes.
cRedstoneSimulator * GetRedstoneSimulator(void)
This class bridges a vector of cItem for safe access via Lua.
void BroadcastWholeWindow(void)
Sends the contents of the whole window to all clients of this window.