5 #include "../FastRandom.h"
24 if (a_BlockMeta == 0x03)
40 auto oldMeta = a_Chunk.
GetMeta(a_RelPos);
41 auto meta = std::min(oldMeta + a_NumStages, 3);
45 return meta - oldMeta;
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
static unsigned char ToolFortuneLevel(const cItem *a_Tool)
Returns the fortune level of a tool, if it is a valid tool.
static char FortuneDiscreteRandom(char a_MinDrop, char a_DefaultMax, unsigned char a_BonusMax, char a_DropCap=25)
Returns a random number of drops taking into account fortune.
const BLOCKTYPE m_BlockType
virtual bool CanBeAt(const cChunk &a_Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta) const override
Checks if the block can stay at the specified relative coords in the chunk.
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
virtual int Grow(cChunk &a_Chunk, Vector3i a_RelPos, int a_NumStages=1) const override
Grows this block, if it supports growing, by the specified amount of stages (at most).
Base class for plants that use light values to decide whether to grow or not.
virtual PlantAction CanGrow(cChunk &a_Chunk, Vector3i a_RelPos) const
Checks whether a plant can grow grow, based on what is returned from cBlockPlant::HasEnoughLight and ...
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta)
BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
This class bridges a vector of cItem for safe access via Lua.
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.