4 #include "../EffectID.h"
21 if ((a_OldBlockMeta & 0x08) != 0)
23 const auto Lower = a_BlockPos.
addedY(-1);
32 const auto Upper = a_BlockPos.
addedY(1);
58 switch (a_ChunkInterface.
GetBlock(a_BlockPos))
62 ASSERT(!
"Unhandled door block type");
78 OnCancelRightClick(a_ChunkInterface, a_WorldInterface, a_Player, a_BlockPos, a_BlockFace);
103 a_WorldInterface.
SendBlockTo(a_BlockPos, a_Player);
188 switch (a_Meta & 0x03)
190 case 0x03:
return 0x01 + OtherMeta;
191 case 0x01:
return 0x03 + OtherMeta;
221 switch (a_Meta & 0x03)
223 case 0x00:
return 0x02 + OtherMeta;
224 case 0x02:
return 0x00 + OtherMeta;
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
@ SFX_RANDOM_WOODEN_DOOR_OPEN
virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) const override
virtual cBoundingBox GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP) const override
static void ChangeDoor(cChunkInterface &a_ChunkInterface, const Vector3i a_BlockPos)
Changes the door at the specified coords from open to close or vice versa.
virtual bool OnUse(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace, const Vector3i a_CursorPos) const override
virtual void OnCancelRightClick(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace) const override
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) const override
static bool IsDoorBlockType(BLOCKTYPE a_Block)
Returns true if the specified blocktype is any kind of door.
virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) const override
virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) const override
virtual void OnBroken(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta, const cEntity *a_Digger) const override
void SetBlock(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Sets the block at the specified coords to the specified value.
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
BLOCKTYPE GetBlock(Vector3i a_Pos)
virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) const override
virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) const override
virtual void SendBlockTo(int a_BlockX, int a_BlockY, int a_BlockZ, const cPlayer &a_Player)=0
Sends the block on those coords to the player.
Represents two sets of coords, minimum and maximum for each direction.
cWorld * GetWorld(void) const
cClientHandle * GetClientHandle(void) const
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