57 if (a_Position.
y <= 0)
77 auto blockMeta = a_Chunk.
GetMeta(a_RelPos);
bool IsBlockTypeOfDirt(BLOCKTYPE a_BlockType)
@ E_META_TALL_GRASS_GRASS
@ E_META_BIG_FLOWER_DOUBLE_TALL_GRASS
@ E_META_BIG_FLOWER_LARGE_FERN
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
MTRand & GetRandomProvider()
Returns the current thread's random number source.
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.
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
const BLOCKTYPE m_BlockType
Handles the grass that is 1 block tall.
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
Growing a tall grass produces a big flower (2-block high fern or double-tall grass).
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 bool DoesIgnoreBuildCollision(const cWorld &a_World, const cItem &a_HeldItem, const Vector3i a_Position, const NIBBLETYPE a_Meta, const eBlockFace a_ClickedBlockFace, const bool a_ClickedDirectly) const override
Checks if the player can build "inside" this block.
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.
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
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.