10 public cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, false>
27 Vector3i Coords(a_BlockX, a_BlockY, a_BlockZ);
62 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
63 int a_CursorX,
int a_CursorY,
int a_CursorZ,
110 ASSERT(!
"Unhandled block meta!");
161 case 0x00:
return 0x07;
162 case 0x07:
return 0x00;
164 case 0x05:
return 0x06;
165 case 0x06:
return 0x05;
179 case 0x00:
return 0x07;
180 case 0x07:
return 0x00;
182 case 0x05:
return 0x06;
183 case 0x06:
return 0x05;
206 return ((a_BlockMeta & 0x8) == 0x8);
unsigned char BLOCKTYPE
The datatype used by blockdata.
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 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.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
static eBlockFace BlockMetaDataToBlockFace(NIBBLETYPE a_Meta)
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 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)
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...
Mixin for rotations and reflections following the standard pattern of "apply mask, then use a switch".
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
virtual bool IsUseable(void) override
Checks if the block can be placed at this point.
static NIBBLETYPE LeverDirectionToMetaData(eBlockFace a_Dir)
Vector3< double > Vector3d
static bool IsLeverOn(NIBBLETYPE a_BlockMeta)
Extracts the ON bit from metadata and returns if true if it is set.
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.
static bool FullyOccupiesVoxel(BLOCKTYPE a_Type)
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
Rotates a given block meta clockwise.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
cBlockLeverHandler(BLOCKTYPE a_BlockType)
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
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 ...
virtual void WakeUpSimulators(Vector3i a_Block)=0
Wakes up the simulators for the specified block.
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
Rotates a given block meta clockwise.
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.
virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
Rotates a given block meta counter-clockwise.
virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
Rotates a given block meta counter-clockwise.
static bool IsAnySlabType(BLOCKTYPE a_BlockType)
Returns true if the specified blocktype is one of the slabs handled by this handler.
#define UNREACHABLE(x)
Use to mark code that should be impossible to reach.
virtual cBroadcastInterface & GetBroadcastManager()=0
This class bridges a vector of cItem for safe access via Lua.