27 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace
39 int CenterX =
FloorC(a_Player->
GetPosX() / RegionWidth) * RegionWidth + (RegionWidth / 2);
40 int CenterZ =
FloorC(a_Player->
GetPosZ() / RegionWidth) * RegionWidth + (RegionWidth / 2);
47 ASSERT(!
"Inventory mismatch");
51 if (NewMap ==
nullptr)
cMap * CreateMap(int a_CenterX, int a_CenterY, unsigned int a_Scale=3)
Creates a new map.
double GetPosX(void) const
bool RemoveOneEquippedItem(void)
Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed.
Encapsulates an in-game world map.
static const unsigned int DEFAULT_SCALE
unsigned int GetID(void) const
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld...
cMapManager & GetMapManager(void)
Returns the associated map manager instance.
int AddItem(const cItem &a_ItemStack, bool a_AllowNewStacks=true)
Adds as many items out of a_ItemStack as can fit.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
double GetPosZ(void) const
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)
cInventory & GetInventory(void)
virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cBlockPluginInterface &a_PluginInterface, const cItem &a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
Called when the player tries to use the item (right mouse button).