39 const bool ShouldSoak = std::any_of(WaterCheck.cbegin(), WaterCheck.cend(), [a_Rel, & a_Chunk](
Vector3i a_Offset)
41 BLOCKTYPE NeighborType;
43 a_Chunk.UnboundedRelGetBlockType(a_Rel.x + a_Offset.x, a_Rel.y + a_Offset.y, a_Rel.z + a_Offset.z, NeighborType)
44 && IsBlockWater(NeighborType)
51 BlockMeta = a_Chunk.
GetMeta(a_Rel.
x, a_Rel.
y, a_Rel.
z);
78 ASSERT(!
"Unhandled meta in concrete powder handler!");
@ E_META_CONCRETE_POWDER_LIGHTGRAY
@ E_META_CONCRETE_POWDER_LIGHTBLUE
@ E_META_CONCRETE_POWDER_YELLOW
@ E_META_CONCRETE_POWDER_BLUE
@ E_META_CONCRETE_POWDER_PURPLE
@ E_META_CONCRETE_POWDER_PINK
@ E_META_CONCRETE_POWDER_LIGHTGREEN
@ E_META_CONCRETE_POWDER_BROWN
@ E_META_CONCRETE_POWDER_BLACK
@ E_META_CONCRETE_POWDER_MAGENTA
@ E_META_CONCRETE_POWDER_GRAY
@ E_META_CONCRETE_POWDER_GREEN
@ E_META_CONCRETE_POWDER_ORANGE
@ E_META_CONCRETE_POWDER_RED
@ E_META_CONCRETE_POWDER_WHITE
@ E_META_CONCRETE_POWDER_CYAN
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.
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 void OnNeighborChanged(cChunkInterface &a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor) const override
Called when a direct neighbor of this block has been changed.
static void CheckSoaked(Vector3i a_Rel, cChunk &a_Chunk)
Check blocks above and around to see if they are water.
virtual void OnPlaced(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) const override
Called by cWorld::SetBlock() after the block has been set.
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
bool DoWithChunkAt(Vector3i a_BlockPos, cFunctionRef< bool(cChunk &)> a_Callback)
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
static void AbsoluteToRelative(int &a_X, int &a_Y, int &a_Z, int &a_ChunkX, int &a_ChunkZ)
Converts absolute block coords into relative (chunk + block) coords:
static constexpr std::array< Vector3i, 6 > AdjacentOffsets
Contains offsets for direct adjacents of any position.