15 public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>>
28 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
29 int a_CursorX,
int a_CursorY,
int a_CursorZ,
40 a_ChunkInterface.
SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, ((a_ChunkInterface.
GetBlockMeta({a_BlockX, a_BlockY, a_BlockZ}) + 0x04) & 0x0f));
47 a_WorldInterface.
SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player);
64 a_Chunk.
GetBlockTypeMeta(a_RelX, a_RelY - 1, a_RelZ, BelowBlock, BelowBlockMeta);
73 if ((BelowBlockMeta & 0x08) == 0x08)
83 a_Rotation += 90 + 45;
89 if ((a_Rotation >= 0) && (a_Rotation < 90))
93 else if ((a_Rotation >= 180) && (a_Rotation < 270))
97 else if ((a_Rotation >= 90) && (a_Rotation < 180))
116 switch (a_Meta & 0x3)
118 case 0x0:
return {0, 0, 1};
119 case 0x1:
return {-1, 0, 0};
120 case 0x2:
return {0, 0, -1};
121 case 0x3:
return {1, 0, 0};
124 LOGWARNING(
"%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
125 ASSERT(!
"Unknown metadata while determining orientation of repeater!");
134 switch (a_Meta & 0x3)
136 case 0x0:
return {0, 0, -1};
137 case 0x1:
return {1, 0, 0};
138 case 0x2:
return {0, 0, 1};
139 case 0x3:
return {-1, 0, 0};
142 LOGWARNING(
"%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
143 ASSERT(!
"Unknown metadata while determining orientation of repeater!");
static NIBBLETYPE RepeaterRotationToMetaData(double a_Rotation)
virtual bool IsUseable(void) override
Checks if the block can be placed at this point.
void GetBlockTypeMeta(Vector3i a_RelPos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
unsigned char BLOCKTYPE
The datatype used by blockdata.
static Vector3i GetRearCoordinateOffset(NIBBLETYPE a_Meta)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
cBlockRedstoneRepeaterHandler(BLOCKTYPE a_BlockType)
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...
static Vector3i GetFrontCoordinateOffset(NIBBLETYPE a_Meta)
void LOGWARNING(const char *a_Format, fmt::ArgList a_ArgList)
virtual void OnCancelRightClick(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
Called when a right click to this block is cancelled.
static bool FullyOccupiesVoxel(BLOCKTYPE a_Type)
double GetYaw(void) const
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
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...
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 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.
Mixin to clear the block's meta value when converting to a pickup.
virtual void SendBlockTo(int a_BlockX, int a_BlockY, int a_BlockZ, cPlayer &a_Player)=0
Sends the block on those coords to the player.
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.
static bool IsAnySlabType(BLOCKTYPE a_BlockType)
Returns true if the specified blocktype is one of the slabs handled by this handler.