6 #include "../Blocks/BlockDoor.h"
51 const auto UpperBlockPosition = a_PlacePosition.
addedY(1);
57 World.GetBlockTypeMeta(UpperBlockPosition, TopType, TopMeta);
59 if (!
cBlockHandler::For(TopType).DoesIgnoreBuildCollision(
World, a_HeldItem, UpperBlockPosition, TopMeta, a_ClickedBlockFace,
false))
68 Vector3i LeftNeighborPos = RelDirToOutside;
70 LeftNeighborPos.
Move(a_PlacePosition);
71 Vector3i RightNeighborPos = RelDirToOutside;
73 RightNeighborPos.
Move(a_PlacePosition);
98 UpperBlockMeta = 0x09;
104 { a_PlacePosition,
BlockType, LowerBlockMeta },
105 { UpperBlockPosition,
BlockType, UpperBlockMeta }
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.
Utilities to allow casting a cWorld to one of its interfaces without including World....
static bool IsSolid(BLOCKTYPE Block)
Is this block solid (player cannot walk through)?
static Vector3i GetRelativeDirectionToOutside(NIBBLETYPE a_BlockMeta)
Returns a vector pointing one block in the direction the door is facing (where the outside is).
static bool IsDoorBlockType(BLOCKTYPE a_Block)
Returns true if the specified blocktype is any kind of door.
static const cBlockHandler & For(BLOCKTYPE a_BlockType)
static NIBBLETYPE YawToMetaData(double a_Rotation)
Converts the rotation value as returned by cPlayer::GetYaw() to the appropriate metadata value for a ...
double GetYaw(void) const
cWorld * GetWorld(void) const
bool PlaceBlocks(std::initializer_list< sSetBlock > a_Blocks)
Calls the block placement hooks and places the blocks in the world.
virtual bool CommitPlacement(cPlayer &a_Player, const cItem &a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override
Performs the actual placement of this placeable item.
constexpr cItemDoorHandler(int a_ItemType)
virtual bool IsPlaceable(void) const override
Blocks simply get placed.
constexpr cItemHandler(int a_ItemType)
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
void Move(T a_X, T a_Y, T a_Z)
void TurnCCW(void)
Rotates the vector 90 degrees counterclockwise around the vertical axis.
void TurnCW(void)
Rotates the vector 90 degrees clockwise around the vertical axis.