27 if (!a_Player.
Feed(2, 0.4))
34 a_ChunkInterface.
DigBlock(a_WorldInterface, {a_BlockX, a_BlockY, a_BlockZ});
38 a_ChunkInterface.
SetBlockMeta({a_BlockX, a_BlockY, a_BlockZ}, Meta + 1);
cBlockCakeHandler(BLOCKTYPE a_BlockType)
unsigned char BLOCKTYPE
The datatype used by blockdata.
cBlockHandler(BLOCKTYPE a_BlockType)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity *a_BlockEntity, const cEntity *a_Digger, const cItem *a_Tool) override
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
bool Feed(int a_Food, double a_Saturation)
Adds to FoodLevel and FoodSaturationLevel, returns true if any food has been consumed, false if player "full".
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...
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
virtual bool IsUseable(void) override
Checks if the block can be placed at this point.
void SetBlockMeta(Vector3i a_BlockPos, NIBBLETYPE a_MetaData, bool a_ShouldMarkDirty=true, bool a_ShouldInformClient=true)
Sets the meta for the specified block, while keeping the blocktype.
bool DigBlock(cWorldInterface &a_WorldInterface, Vector3i a_BlockPos)
This class bridges a vector of cItem for safe access via Lua.