6 #include "../Entities/Player.h" 7 #include "../Entities/Painting.h" 26 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace
43 } gPaintingTitlesList[] =
73 auto Painting = cpp14::make_unique<cPainting>(gPaintingTitlesList[a_World->
GetTickRandomNumber(
ARRAYCOUNT(gPaintingTitlesList) - 1)].Title, a_BlockFace,
Vector3i{a_BlockX, a_BlockY, a_BlockZ});
74 auto PaintingPtr = Painting.get();
75 if (!PaintingPtr->Initialize(std::move(Painting), *a_World))
BLOCKTYPE GetBlock(Vector3i a_BlockPos)
Returns the block type at the specified position.
unsigned char BLOCKTYPE
The datatype used by blockdata.
bool RemoveOneEquippedItem(void)
Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed.
int GetTickRandomNumber(int a_Range)
Returns a random number in range [0 .
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld...
void AddFaceDirection(int &a_BlockX, int &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse=false)
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).
cItemPaintingHandler(int a_ItemType)
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
bool IsGameModeCreative(void) const
Returns true if the player is in Creative mode, either explicitly, or by inheriting from current worl...
cInventory & GetInventory(void)
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)