19 public cMetaRotator<cBlockEntityHandler, 0x3, 0x02, 0x03, 0x00, 0x01, true>
47 a_Rotation += 180 + (180 / 4);
53 a_Rotation = (a_Rotation / 360) * 4;
55 return (static_cast<NIBBLETYPE>(a_Rotation + 2)) % 4;
80 auto Meta = a_ChunkInterface.
GetBlockMeta(a_BedPosition);
virtual void OnPlacedByPlayer(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const sSetBlock &a_BlockChange) override
Called by cPlayer::PlaceBlocks() for each block after it has been set to the world.
cBlockBedHandler(BLOCKTYPE a_BlockType)
unsigned char BLOCKTYPE
The datatype used by blockdata.
virtual void OnBroken(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta) override
Called after a block gets broken (replaced with air), either by player or by natural means...
static Vector3i MetaDataToDirection(NIBBLETYPE a_MetaData)
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 void SetBedOccupationState(cChunkInterface &a_ChunkInterface, Vector3i a_BedPosition, bool a_IsOccupied)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
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...
Mixin for rotations and reflections following the standard pattern of "apply mask, then use a switch".
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
static NIBBLETYPE RotationToMetaData(double a_Rotation)
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
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 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.
This class bridges a vector of cItem for safe access via Lua.