4 #include "../BlockInfo.h"
23 if (a_Position.
y <= 0)
42 for (
size_t i = 0; i <
ARRAYCOUNT(Coords); i++)
78 int top = a_RelPos.
y + 1;
86 int bottom = a_RelPos.
y - 1;
103 for (
int i = 0; i < numToGrow; ++i)
105 Vector3i pos(a_RelPos.
x, top + i, a_RelPos.
z);
115 static const Vector3i neighborOffsets[] =
122 for (
const auto & ofs: neighborOffsets)
@ E_BLOCK_STATIONARY_LAVA
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
static bool IsSolid(BLOCKTYPE Block)
Is this block solid (player cannot walk through)?
virtual PlantAction CanGrow(cChunk &a_Chunk, Vector3i a_RelPos) const override
Checks whether a plant can grow grow, based on what is returned from cBlockPlant::HasEnoughLight and ...
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 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 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).
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 ...
PlantAction
The action the plant can take on an update.
Mixin to clear the block's meta value when converting to a pickup.
BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
Vector3i RelativeToAbsolute(Vector3i a_RelBlockPosition) const
Converts the coord relative to this chunk into an absolute coord.
bool UnboundedRelFastSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Same as FastSetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap...
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 ...
cWorld * GetWorld(void) const
bool UnboundedRelGetBlockType(Vector3i a_RelCoords, BLOCKTYPE &a_BlockType) const
Same as GetBlockType(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap...
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
bool DropBlockAsPickups(Vector3i a_BlockPos, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr)
Digs the specified block, and spawns the appropriate pickups for it.
int GetMaxCactusHeight(void) const