4 #include "../EffectID.h" 21 if ((a_OldBlockMeta & 0x08) != 0)
51 switch (a_ChunkInterface.
GetBlock({a_BlockX, a_BlockY, a_BlockZ}))
55 ASSERT(!
"Unhandled door block type");
64 ChangeDoor(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ);
71 OnCancelRightClick(a_ChunkInterface, a_WorldInterface, a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
87 a_WorldInterface.
SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player);
93 a_WorldInterface.
SendBlockTo(a_BlockX, a_BlockY - 1, a_BlockZ, a_Player);
98 a_WorldInterface.
SendBlockTo(a_BlockX, a_BlockY + 1, a_BlockZ, a_Player);
172 switch (a_Meta & 0x03)
174 case 0x03:
return 0x01 + OtherMeta;
175 case 0x01:
return 0x03 + OtherMeta;
205 switch (a_Meta & 0x03)
207 case 0x00:
return 0x02 + OtherMeta;
208 case 0x02:
return 0x00 + OtherMeta;
virtual cBoundingBox GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP) override
Returns the relative bounding box that must be entity-free in order for the block to be placed...
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 void ChangeDoor(cChunkInterface &a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
Changes the door at the specified coords from open to close or vice versa.
cBlockDoorHandler(BLOCKTYPE a_BlockType)
unsigned char BLOCKTYPE
The datatype used by blockdata.
static bool IsDoorBlockType(BLOCKTYPE a_Block)
Returns true if the specified blocktype is any kind of door.
virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override
Mirros a given block meta around the YZ plane.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Represents two sets of coords, minimum and maximum for each direction.
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
virtual void BroadcastSoundParticleEffect(const EffectID a_EffectID, Vector3i a_SrcPos, int a_Data, const cClientHandle *a_Exclude=nullptr) override
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
Rotates a given block meta clockwise.
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 DropBlockAsPickups(Vector3i a_BlockPos, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr)
Digs the block and spawns the relevant pickups, as if a_Digger used a_Tool to dig the block...
virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override
Mirrors a given block meta around the XY plane.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
BLOCKTYPE GetBlock(Vector3i a_Pos)
virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
Rotates a given block meta counter-clockwise.
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
Rotates a given block meta clockwise.
virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
Rotates a given block meta counter-clockwise.
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 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...
cWorld * GetWorld(void) const
cClientHandle * GetClientHandle(void) const
Returns the raw client handle associated with the player.