13 #include "../ItemGrid.h"
14 #include "../UI/WindowOwner.h"
39 int a_ItemGridWidth,
int a_ItemGridHeight,
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
cBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
cItemGrid & GetContents(void)
Returns the ItemGrid used for storing the contents.
void SetSlot(int a_X, int a_Y, const cItem &a_Item)
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
virtual cItems ConvertToPickups() const override
Returns the contents of this block entity that it would drop if broken.
const cItemGrid & GetContents(void) const
Const version of the GetContents() function for C++ type-safety.
const cItem & GetSlot(int a_SlotNum) const
const cItem & GetSlot(int a_X, int a_Y) const
cBlockEntityWithItems(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, int a_ItemGridWidth, int a_ItemGridHeight, cWorld *a_World)
virtual void OnSlotChanged(cItemGrid *a_Grid, int a_SlotNum) override
Called whenever a slot changes.
void SetSlot(int a_SlotNum, const cItem &a_Item)
This class bridges a vector of cItem for safe access via Lua.
void SetSlot(int a_X, int a_Y, const cItem &a_Item)
const cItem & GetSlot(int a_X, int a_Y) const
This class is used as a callback for when a slot changes.
Window owner that is associated with a block entity (chest, furnace, ...)