11 public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true>>
28 Vector3i Pos(a_BlockX, a_BlockY, a_BlockZ);
42 a_ChunkInterface.
SetBlockMeta({a_BlockX, a_BlockY, a_BlockZ}, Meta,
false);
70 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
71 int a_CursorX,
int a_CursorY,
int a_CursorZ,
92 ASSERT(!
"Unhandled block face!");
101 switch (a_Meta & 0x7)
111 ASSERT(!
"Unhandled block meta!");
137 return ((a_BlockMeta & 0x8) == 0x8);
BLOCKTYPE GetBlock(Vector3i a_BlockPos)
Returns the block type at the specified position.
unsigned char BLOCKTYPE
The datatype used by blockdata.
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...
cBlockButtonHandler(BLOCKTYPE a_BlockType)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
virtual void WakeUpSimulators(Vector3i a_Block) override
Wakes up the simulators for the specified block.
bool UnboundedRelGetBlockMeta(Vector3i a_RelPos, NIBBLETYPE &a_BlockMeta) const
Same as GetBlockMeta(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap...
NIBBLETYPE GetBlockMeta(Vector3i a_BlockPos)
Returns the block meta at the specified position.
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr)=0
void AddFaceDirection(int &a_BlockX, int &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse=false)
static bool IsButtonOn(NIBBLETYPE a_BlockMeta)
Extracts the ON bit from metadata and returns if true if it is set.
virtual bool OnUse(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
Called if the user right clicks the block and the block is useable returns true if the use was succes...
virtual bool IsUseable(void) override
Checks if the block can be placed at this point.
void ScheduleTask(int a_DelayTicks, std::function< void(cWorld &)> a_Task)
Queues a lambda task onto the tick thread, with the specified delay.
static bool FullyOccupiesVoxel(BLOCKTYPE a_Type)
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
static eBlockFace BlockMetaDataToBlockFace(NIBBLETYPE a_Meta)
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
virtual void WakeUpSimulators(Vector3i a_Block)=0
Wakes up the simulators for the specified block.
virtual bool CanBeAt(cChunkInterface &a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk &a_Chunk) override
Checks if the block can stay at the specified relative coords in the chunk.
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...
void SetBlockMeta(Vector3i a_BlockPos, NIBBLETYPE a_MetaData, bool a_ShouldMarkDirty=true, bool a_ShouldInformClient=true)
Sets the meta for the specified block, while keeping the blocktype.
Mixin to clear the block's meta value when converting to a pickup.
static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace)
void SetBlockMeta(Vector3i a_BlockPos, NIBBLETYPE a_MetaData, bool a_ShouldMarkDirty=true, bool a_ShouldInformClients=true)
Sets the meta for the specified block, while keeping the blocktype.
#define UNREACHABLE(x)
Use to mark code that should be impossible to reach.
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 cBroadcastInterface & GetBroadcastManager()=0
cWorld * GetWorld(void) const