6 #include "../BlockInfo.h"
18 public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true>>
29 return (a_Meta & 0x08) == 0x08;
84 const auto SoundToPlay = (m_BlockType ==
E_BLOCK_STONE_BUTTON) ?
"block.stone_button.click_on" :
"block.wood_button.click_on";
112 switch (a_Meta & 0x7)
122 ASSERT(!
"Unhandled block meta!");
192 [a_Position, a_BlockType](
cWorld & a_World)
214 const auto SoundToPlayOnRelease = (
Type ==
E_BLOCK_STONE_BUTTON) ?
"block.stone_button.click_off" :
"block.wood_button.click_off";
@ E_META_WOODEN_SLAB_UPSIDE_DOWN
@ E_BLOCK_STAIRS_UPSIDE_DOWN
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
void AddFaceDirection(int &a_BlockX, int &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse)
Modifies the specified coords so that they point to the block adjacent to the one specified through i...
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
static bool FullyOccupiesVoxel(BLOCKTYPE Block)
Does this block fully occupy its voxel - is it a 'full' block?
static bool IsButtonOn(NIBBLETYPE a_Meta)
Extracts the ON bit from metadata and returns if true if it is set.
static void QueueButtonRelease(cWorld &a_ButtonWorld, const Vector3i a_Position, const BLOCKTYPE a_BlockType)
Schedules a recurring event at appropriate intervals to release a button at a given position.
static Vector3d GetButtonOffsetOnBlock(NIBBLETYPE a_Meta)
Returns an offset to the integer world coordinates of a button.
virtual bool CanBeAt(const cChunk &a_Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta) const override
virtual bool IsUseable(void) const override
static eBlockFace BlockMetaDataToBlockFace(NIBBLETYPE a_Meta)
Converts the block meta of this button into a block face of the neighbor to which the button is attac...
virtual bool OnUse(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace, const Vector3i a_CursorPos) const override
static void OnArrowHit(cWorld &a_World, const Vector3i a_Position, const eBlockFace a_HitFace)
Event handler for an arrow striking a block.
static bool IsButtonPressedByArrow(cWorld &a_World, const Vector3i a_ButtonPosition, const BLOCKTYPE a_BlockType, const NIBBLETYPE a_Meta)
Returns true if an arrow was found in the wooden button.
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
static bool IsAnySlabType(BLOCKTYPE a_BlockType)
Returns true if the specified blocktype is one of the slabs handled by this handler.
static bool IsAnyStairType(BLOCKTYPE a_Block)
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr)=0
void SetBlockMeta(Vector3i a_BlockPos, NIBBLETYPE a_MetaData)
Sets the meta for the specified block, while keeping the blocktype.
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
Mixin to clear the block's meta value when converting to a pickup.
virtual cBroadcastInterface & GetBroadcastManager()=0
virtual void WakeUpSimulators(Vector3i a_Block)=0
Wakes up the simulators for the specified block.
Represents two sets of coords, minimum and maximum for each direction.
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 ...
static bool IsValidHeight(Vector3i a_BlockPosition)
Validates a height-coordinate.
cWorld * GetWorld(void) const
cClientHandle * GetClientHandle(void) const
void ScheduleTask(cTickTime a_DelayTicks, std::function< void(cWorld &)> a_Task)
Queues a lambda task onto the tick thread, with the specified delay.
virtual cBroadcastInterface & GetBroadcastManager(void) override
bool GetBlockTypeMeta(Vector3i a_BlockPos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
Retrieves the block type and meta at the specified coords.
virtual bool ForEachEntityInBox(const cBoundingBox &a_Box, cEntityCallback a_Callback) override
Calls the callback for each entity that has a nonempty intersection with the specified boundingbox.
virtual void WakeUpSimulators(Vector3i a_Block) override
Wakes up the simulators for the specified block.
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr) override
void SetBlockMeta(Vector3i a_BlockPos, NIBBLETYPE a_MetaData)
Sets the meta for the specified block, while keeping the blocktype.