107 for (
auto & Coord : Coords)
111 auto checkPos = a_Position.
addedXZ(Coord.x, Coord.z);
117 MaxMeta |= Coord.Bit;
128 if (Common != a_CurrentMeta)
131 if ((Common == 0) && !HasTop)
201 auto GrowPos = a_RelPos.
addedY(-1);
226 return ((a_Meta >> 1) | (a_Meta << 3)) & 0x0f;
235 return ((a_Meta << 1) | (a_Meta >> 3)) & 0x0f;
245 return static_cast<NIBBLETYPE>((a_Meta & 0x0a) | ((a_Meta & 0x01) << 2) | ((a_Meta & 0x04) >> 2));
255 return static_cast<NIBBLETYPE>((a_Meta & 0x05) | ((a_Meta & 0x02) << 2) | ((a_Meta & 0x08) >> 2));
@ E_BLOCK_REDSTONE_REPEATER_ON
@ E_BLOCK_PISTON_EXTENSION
@ E_BLOCK_REDSTONE_REPEATER_OFF
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.
static bool IsSolid(BLOCKTYPE Block)
Is this block solid (player cannot walk through)?
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
const BLOCKTYPE m_BlockType
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld.
virtual bool CallHookBlockSpread(Vector3i a_BlockPos, eSpreadSource a_Source)=0
static NIBBLETYPE GetMaxMeta(const cChunk &a_Chunk, const Vector3i a_Position, const NIBBLETYPE a_CurrentMeta)
Returns the meta that has the maximum allowable sides of the vine, given the surroundings and current...
virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) const override
Mirros a given block meta around the YZ plane.
static const NIBBLETYPE VINE_LOST_SUPPORT
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) const override
Rotates a given block meta clockwise.
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.
static const NIBBLETYPE VINE_UNCHANGED
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...
static bool IsBlockAttachable(BLOCKTYPE a_BlockType)
Returns true if the specified block type is good for vines to attach to.
virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) const override
Rotates a given block meta counter-clockwise.
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.
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.
static char MetaDataToDirection(NIBBLETYPE a_MetaData)
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 NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) const override
Mirrors a given block meta around the XY plane.
virtual void OnUpdate(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cBlockPluginInterface &a_PluginInterface, cChunk &a_Chunk, const Vector3i a_RelPos) const override
Called when the block gets ticked either by a random tick or by a queued tick.
bool DoWithChunkAt(Vector3i a_BlockPos, cFunctionRef< bool(cChunk &)> a_Callback)
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
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.
void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
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 ...
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 ...
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...
static bool IsValidHeight(Vector3i a_BlockPosition)
Validates a height-coordinate.
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:
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.
Vector3< T > addedXZ(T a_AddX, T a_AddZ) const
Returns a copy of this vector moved by the specified amount on the X and Z axes.