6 #include "../EffectID.h" 12 public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x02, 0x03, 0x00, 0x01, true>>
25 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
26 int a_CursorX,
int a_CursorY,
int a_CursorZ,
41 if ((OldMetaData & 1) == (NewMetaData & 1))
44 a_ChunkInterface.
SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, (OldMetaData & 4) | (NewMetaData & 3));
49 a_ChunkInterface.
SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, OldMetaData);
57 a_WorldInterface.
SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player);
68 ASSERT((a_Yaw >= -180) && (a_Yaw < 180));
75 if ((a_Yaw >= 0) && (a_Yaw < 90))
79 else if ((a_Yaw >= 180) && (a_Yaw < 270))
83 else if ((a_Yaw >= 90) && (a_Yaw < 180))
106 ASSERT(!
"Unhandled blocktype in fence gate handler!");
cBlockFenceGateHandler(BLOCKTYPE a_BlockType)
unsigned char BLOCKTYPE
The datatype used by blockdata.
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...
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
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.
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 void BroadcastSoundParticleEffect(const EffectID a_EffectID, Vector3i a_SrcPos, int a_Data, const cClientHandle *a_Exclude=nullptr) override
double GetYaw(void) const
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
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...
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
static NIBBLETYPE PlayerYawToMetaData(double a_Yaw)
Converts the player's yaw to placed gate's blockmeta.
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 IsUseable(void) override
Checks if the block can be placed at this point.
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.
cWorld * GetWorld(void) const
cClientHandle * GetClientHandle(void) const
Returns the raw client handle associated with the player.