6 #include "../Blocks/BlockDoor.h" 25 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
26 int a_CursorX,
int a_CursorY,
int a_CursorZ,
61 ASSERT(!
"Unhandled door type");
79 Vector3i LeftNeighborPos = RelDirToOutside;
81 LeftNeighborPos.
Move(a_BlockX, a_BlockY, a_BlockZ);
82 Vector3i RightNeighborPos = RelDirToOutside;
84 RightNeighborPos.
Move(a_BlockX, a_BlockY, a_BlockZ);
107 UpperBlockMeta = 0x09;
111 a_BlocksToSet.emplace_back(a_BlockX, a_BlockY, a_BlockZ, BlockType, LowerBlockMeta);
112 a_BlocksToSet.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, BlockType, UpperBlockMeta);
BLOCKTYPE GetBlock(Vector3i a_BlockPos)
Returns the block type at the specified position.
virtual bool GetBlocksToPlace(cWorld &a_World, cPlayer &a_Player, const cItem &a_EquippedItem, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, sSetBlockVector &a_BlocksToSet) override
Called from OnPlayerPlace() to determine the blocks that the current placement operation should set...
static bool IsSolid(BLOCKTYPE a_Type)
unsigned char BLOCKTYPE
The datatype used by blockdata.
void TurnCCW(void)
Rotates the vector 90 degrees counterclockwise around the vertical axis.
static bool IsDoorBlockType(BLOCKTYPE a_Block)
Returns true if the specified blocktype is any kind of door.
static Vector3i GetRelativeDirectionToOutside(NIBBLETYPE a_BlockMeta)
Returns a vector pointing one block in the direction the door is facing (where the outside is)...
void Move(T a_X, T a_Y, T a_Z)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
NIBBLETYPE GetBlockMeta(Vector3i a_BlockPos)
Returns the block meta at the specified position.
cItemDoorHandler(int a_ItemType)
static NIBBLETYPE PlayerYawToMetaData(double a_Yaw)
Converts the player's yaw to placed door's blockmeta.
double GetYaw(void) const
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
virtual bool IsPlaceable(void) override
Blocks simply get placed.
static bool CanBeOn(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Returns true if door can be placed on the specified block type.
static bool CanReplaceBlock(BLOCKTYPE a_BlockType)
void TurnCW(void)
Rotates the vector 90 degrees clockwise around the vertical axis.
std::vector< sSetBlock > sSetBlockVector