42 switch (a_Chunk.
GetBlock(a_RelX, a_RelY - 1, a_RelZ))
60 for (
size_t i = 0; i <
ARRAYCOUNT(Coords); i++)
64 if (!a_Chunk.
UnboundedRelGetBlock(a_RelX + Coords[i].x, a_RelY, a_RelZ + Coords[i].z, BlockType, BlockMeta))
102 int top = a_RelPos.
y + 1;
110 int bottom = a_RelPos.
y - 1;
122 for (
int i = 0; i < toGrow; i++)
cWorld * GetWorld(void) const
cBlockSugarcaneHandler(BLOCKTYPE a_BlockType)
bool IsBlockWater(BLOCKTYPE a_BlockType)
unsigned char BLOCKTYPE
The datatype used by blockdata.
void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
int GetMaxSugarcaneHeight(void) const
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 CanBeAt(cChunkInterface &a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk &a_Chunk) override
Checks if the block can stay at the specified relative coords in the chunk.
virtual PlantAction CanGrow(cChunk &a_Chunk, Vector3i a_RelPos)
Checks whether a plant can grow grow, based on what is returned from cBlockPlant::HasEnoughLight and ...
virtual int Grow(cChunk &a_Chunk, Vector3i a_RelPos, int a_NumStages=1) override
Grows this block, if it supports growing, by the specified amount of stages (at most).
virtual PlantAction CanGrow(cChunk &a_Chunk, Vector3i a_RelPos) override
Checks whether a plant can grow grow, based on what is returned from cBlockPlant::HasEnoughLight and ...
bool UnboundedRelGetBlock(Vector3i a_RelCoords, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in ...
BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
Base class for plants that use light values to decide whether to grow or not.
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.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
This class bridges a vector of cItem for safe access via Lua.
PlantAction
The action the plant can take on an update.