5 #include "../Items/ItemHandler.h"
31 return a_ChunkInterface.
UseBlockEntity(&a_Player, a_BlockPos.
x, a_BlockPos.
y, a_BlockPos.
z);
64 if (a_Digger ==
nullptr)
73 const auto Player =
static_cast<const cPlayer *
>(a_Digger);
81 int Reward = 15 + Random.RandInt(14) + Random.RandInt(14);
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
MTRand & GetRandomProvider()
Returns the current thread's random number source.
Vector3< double > Vector3d
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
virtual bool IsUseable() const override
Called to check whether this block supports a rclk action.
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
virtual void OnBroken(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta, const cEntity *a_Digger) const override
Called after a block gets broken (replaced with air), by natural means.
virtual bool OnUse(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace, const Vector3i a_CursorPos) const override
Called when the user right clicks the block and the block is useable.
bool UseBlockEntity(cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)
Use block entity on coordinate.
virtual std::vector< UInt32 > SpawnSplitExperienceOrbs(Vector3d a_Pos, int a_Reward)=0
Spawns experience orbs of the specified total value at the given location.
bool IsPlayer(void) const
const cItem & GetEquippedItem(void) const
const cItemHandler & GetHandler(void) const
Returns the cItemHandler responsible for this item type.
This class bridges a vector of cItem for safe access via Lua.