7 #include "../BlockEntities/BlockEntityWithItems.h" 33 return a_ChunkInterface.
UseBlockEntity(&a_Player, a_BlockX, a_BlockY, a_BlockZ);
52 template <
typename Base = cBlockEntityHandler>
73 if (a_BlockEntity !=
nullptr)
Wrapper for blocks that have a cBlockEntity descendant attached to them and can be "used" by the play...
unsigned char BLOCKTYPE
The datatype used by blockdata.
cBlockHandler(BLOCKTYPE a_BlockType)
virtual bool IsUseable() override
Checks if the block can be placed at this point.
virtual bool OnUse(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
Called if the user right clicks the block and the block is useable returns true if the use was succes...
Wrapper for blocks that have a cBlockEntityWithItems descendant attached to them. ...
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
cContainerEntityHandler(BLOCKTYPE a_BlockType)
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity *a_BlockEntity, const cEntity *a_Digger, const cItem *a_Tool) override
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
bool UseBlockEntity(cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)
Use block entity on coordinate.
cBlockEntityHandler(BLOCKTYPE a_BlockType)
This class bridges a vector of cItem for safe access via Lua.
void AddItemGrid(const cItemGrid &a_ItemGrid)
Adds a copy of all items in a_ItemGrid.