25 switch (a_NeighborBlockFace)
33 default:
UNREACHABLE(
"Unsupported neighbor block face");
41 const auto ClickedBlockType =
World.GetBlock(
AddFaceDirection(a_PlacePosition, a_ClickedBlockFace,
true));
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
void AddFaceDirection(int &a_BlockX, int &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse)
Modifies the specified coords so that they point to the block adjacent to the one specified through i...
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 CanBePlacedOn(const BLOCKTYPE a_BlockType, const eBlockFace a_BlockFace)
Returns true if the ladder will be supported by the block through the given blockface.
cWorld * GetWorld(void) const
bool PlaceBlock(Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Attempts to place the block in the world with a call to PlaceBlocks.
constexpr cItemHandler(int a_ItemType)
static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_NeighborBlockFace)
Converts the block face of the neighbor to which the ladder is attached to the ladder block's meta.
virtual bool CommitPlacement(cPlayer &a_Player, const cItem &a_HeldItem, const Vector3i a_PlacePosition, eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override
Performs the actual placement of this placeable item.
static eBlockFace FindSuitableFace(const cWorld &a_World, const Vector3i a_Position)
Returns a suitable neighbor's blockface to place the ladder at the specified position.
BLOCKTYPE GetBlock(Vector3i a_BlockPos) const
Returns the block type at the specified position.