5 #include "../Entities/ItemFrame.h"
6 #include "../Entities/Player.h"
29 const cItem & a_HeldItem,
47 const auto PlacePos =
AddFaceDirection(a_ClickedBlockPos, a_ClickedBlockFace);
55 auto ItemFrame = std::make_unique<cItemFrame>(a_ClickedBlockFace,
Vector3d(0.5, 0.5, 0.5) + PlacePos);
57 if (!ItemFramePtr->Initialize(std::move(
ItemFrame), *a_World))
unsigned char BLOCKTYPE
The datatype used by blockdata.
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.
Vector3< double > Vector3d
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld.
static bool IsValidSupportBlock(BLOCKTYPE a_BlockType)
Returns if the given block can support hanging entity placements.
bool IsGameModeCreative(void) const
Returns true if the player is in Creative mode, either explicitly, or by inheriting from current worl...
cInventory & GetInventory(void)
bool RemoveOneEquippedItem(void)
Removes one item out of the currently equipped item stack, returns true if successful,...
constexpr cItemHandler(int a_ItemType)
virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cBlockPluginInterface &a_PluginInterface, const cItem &a_HeldItem, const Vector3i a_ClickedBlockPos, eBlockFace a_ClickedBlockFace) const override
Called when the player tries to use the item (right mouse button).
BLOCKTYPE GetBlock(Vector3i a_BlockPos) const
Returns the block type at the specified position.