29 const cItem & a_HeldItem,
35 UNUSED(a_ClickedBlockFace);
41 int CenterX =
FloorC(a_Player->
GetPosX() / RegionWidth) * RegionWidth + (RegionWidth / 2);
42 int CenterZ =
FloorC(a_Player->
GetPosZ() / RegionWidth) * RegionWidth + (RegionWidth / 2);
45 if (NewMap ==
nullptr)
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
std::enable_if< std::is_arithmetic< T >::value, C >::type FloorC(T a_Value)
Floors a value, then casts it to C (an int by default).
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld.
double GetPosX(void) const
double GetPosZ(void) const
void ReplaceOneEquippedItemTossRest(const cItem &)
Removes one item from the the current equipped item stack, and attempts to add the specified item sta...
static const unsigned int DEFAULT_SCALE
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).
constexpr cItemHandler(int a_ItemType)
cMap * CreateMap(int a_CenterX, int a_CenterY, unsigned int a_Scale=3)
Creates a new map.
cMapManager & GetMapManager(void)
Returns the associated map manager instance.