27 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
28 int a_CursorX,
int a_CursorY,
int a_CursorZ,
35 a_ChunkInterface.
GetBlockTypeMeta({a_BlockX, a_BlockY, a_BlockZ}, BlockType, BlockMeta);
143 for (
auto & Coord : Coords)
147 auto checkPos = a_RelPos.
addedXZ(Coord.x, Coord.z);
179 if (Common != CurMeta)
183 if ((Common == 0) && !HasTop)
253 return ((a_Meta >> 1) | (a_Meta << 3)) & 0x0f;
262 return ((a_Meta << 1) | (a_Meta >> 3)) & 0x0f;
272 return static_cast<NIBBLETYPE>((a_Meta & 0x0a) | ((a_Meta & 0x01) << 2) | ((a_Meta & 0x04) >> 2));
282 return static_cast<NIBBLETYPE>((a_Meta & 0x05) | ((a_Meta & 0x02) << 2) | ((a_Meta & 0x08) >> 2));
cWorld * GetWorld(void) const
static bool IsBlockAttachable(BLOCKTYPE a_BlockType)
Returns true if the specified block type is good for vines to attach to.
static NIBBLETYPE DirectionToMetaData(char a_BlockFace)
void WakeUp(Vector3i a_Block, cChunk *a_Chunk)
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 DoesDropOnUnsuitable(void) override
Returns if this block drops if it gets destroyed by an unsuitable situation.
static char MetaDataToDirection(NIBBLETYPE a_MetaData)
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
Rotates a given block meta clockwise.
static bool IsSolid(BLOCKTYPE a_Type)
unsigned char BLOCKTYPE
The datatype used by blockdata.
bool GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta)
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.
Vector3i RelativeToAbsolute(Vector3i a_RelBlockPosition)
Converts the coord relative to this chunk into an absolute coord.
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...
cBlockHandler(BLOCKTYPE a_BlockType)
void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
cSimulatorManager * GetSimulatorManager(void)
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 bool GetPlacementBlockTypeMeta(cChunkInterface &a_ChunkInterface, cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) override
Called before a block is placed into a world.
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.
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld...
virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override
Mirrors a given block meta around the XY plane.
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 NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
Rotates a given block meta counter-clockwise.
NIBBLETYPE GetMaxMeta(cChunk &a_Chunk, Vector3i a_RelPos)
Returns the meta that has the maximum allowable sides of the vine, given the surroundings.
void DropBlockAsPickups(Vector3i a_BlockPos, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr)
Digs the block and spawns the relevant pickups, as if a_Digger used a_Tool to dig the block...
virtual void OnUpdate(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cBlockPluginInterface &a_BlockPluginInterface, cChunk &a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
Called when the block gets ticked either by a random tick or by a queued tick.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
virtual bool CallHookBlockSpread(int a_BlockX, int a_BlockY, int a_BlockZ, eSpreadSource a_Source)=0
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.
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
virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override
Mirros a given block meta around the YZ plane.
cBlockVineHandler(BLOCKTYPE a_BlockType)
This class bridges a vector of cItem for safe access via Lua.