30 World.GetBlockTypeMeta(HeadPosition, HeadType, HeadMeta);
34 if (!
cBlockHandler::For(HeadType).DoesIgnoreBuildCollision(
World, a_HeldItem, HeadPosition, HeadMeta, a_ClickedBlockFace,
false))
43 { a_PlacePosition, E_BLOCK_BED, BlockMeta },
44 { HeadPosition, E_BLOCK_BED, static_cast<NIBBLETYPE>(BlockMeta | 0x08) }
51 auto SetColor = [&a_HeldItem](
cBlockEntity & a_BlockEntity)
55 static_cast<cBedEntity &
>(a_BlockEntity).SetColor(a_HeldItem.m_ItemDamage);
58 World.DoWithBlockEntityAt(a_PlacePosition, SetColor);
59 World.DoWithBlockEntityAt(HeadPosition, SetColor);
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 Vector3i MetaDataToDirection(NIBBLETYPE a_MetaData)
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 IsPlaceable(void) const override
Blocks simply get placed.
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 cItemHandler(int a_ItemType)