64 super::Check(a_ChunkInterface, a_PluginInterface, a_RelPos, a_Chunk);
78 ASSERT(!
"Unhandled blocktype in fluid/water handler!");
116 for (
int i = 0; i < 5; i++)
118 TryStartFireNear(a_RelX, a_RelY, a_RelZ, a_Chunk);
128 int x = (rnd % 3) - 1;
129 int y = ((rnd / 4) % 4) - 1;
130 int z = ((rnd / 16) % 3) - 1;
156 int RelX = a_RelX + x;
157 int RelY = a_RelY + y;
158 int RelZ = a_RelZ + z;
159 for (
size_t i = 0; i <
ARRAYCOUNT(CrossCoords); i++)
162 ((RelY + CrossCoords[i].y >= 0) && (RelY + CrossCoords[i].y <
cChunkDef::Height)) &&
163 a_Chunk.
UnboundedRelGetBlockType(RelX + CrossCoords[i].x, RelY + CrossCoords[i].y, RelZ + CrossCoords[i].z, BlockType) &&
cBlockLavaHandler(BLOCKTYPE a_BlockType)
cWorld * GetWorld(void) const
bool IsBlockWater(BLOCKTYPE a_BlockType)
virtual void Check(cChunkInterface &ChunkInterface, cBlockPluginInterface &a_PluginInterface, Vector3i a_RelPos, cChunk &a_Chunk)
Called when one of the neighbors gets set; equivalent to MC block update.
unsigned char BLOCKTYPE
The datatype used by blockdata.
virtual bool DoesIgnoreBuildCollision(cChunkInterface &a_ChunkInterface, Vector3i a_Pos, cPlayer &a_Player, NIBBLETYPE a_Meta) override
Checks if the player can build "inside" this block.
static const int NumBlocks
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...
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
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 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.
int GetTickRandomNumber(int a_Range)
Returns a random number in range [0 .
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld...
static bool TryStartFireNear(int a_RelX, int a_RelY, int a_RelZ, cChunk &a_Chunk)
Tries to start a fire near the lava at given coords.
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
bool UnboundedRelSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Same as SetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in ...
virtual void OnUpdate(cChunkInterface &cChunkInterface, cWorldInterface &a_WorldInterface, cBlockPluginInterface &a_PluginInterface, cChunk &a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
Called to tick the block.
bool ShouldLavaSpawnFire(void) const
virtual void Check(cChunkInterface &a_ChunkInterface, cBlockPluginInterface &a_PluginInterface, Vector3i a_RelPos, cChunk &a_Chunk) override
Called when one of the neighbors gets set; equivalent to MC block update.
virtual bool CanSustainPlant(BLOCKTYPE a_Plant) override
Checks whether the block has an effect on growing the plant.
virtual bool CanSustainPlant(BLOCKTYPE a_Plant) override
Checks whether the block has an effect on growing the plant.
cBlockFluidHandler(BLOCKTYPE a_BlockType)
void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta, bool a_SendToClients=true)
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
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...
static bool IsFuel(BLOCKTYPE a_BlockType)
This class bridges a vector of cItem for safe access via Lua.