4 #include "../Defines.h" 48 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
49 int a_CursorX,
int a_CursorY,
int a_CursorZ
60 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
61 int a_CursorX,
int a_CursorY,
int a_CursorZ,
71 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace,
72 int a_CursorX,
int a_CursorY,
int a_CursorZ,
81 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace
125 FoodLevel(a_FoodLevel),
126 Saturation(a_Saturation)
138 virtual bool IsTool(
void);
141 virtual bool IsFood(
void);
static bool m_HandlerInitialized
cItemHandler(int a_ItemType)
virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType)
Returns whether this tool / item can harvest a specific block (e.g.
static cItemHandler * GetItemHandler(const cItem &a_Item)
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)
Called when the player tries to use the item (right mouse button).
virtual void OnItemShoot(cPlayer *, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace)
Called when the client sends the SHOOT status in the lclk packet.
unsigned char BLOCKTYPE
The datatype used by blockdata.
static cItemHandler * CreateItemHandler(int m_ItemType)
virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block)
Returns the strength to break a specific block.
virtual char GetMaxStackSize(void)
Returns the maximum stack size for a given item.
virtual bool CanRepairWithRawMaterial(short a_ItemType)
Can the anvil repair this item, when a_Item is the second input?
static cItemHandler * GetItemHandler(int a_ItemType)
virtual short GetDurabilityLossByAction(eDurabilityLostAction a_Action)
Get the durability lost which the item will get, when a specified action was performed.
virtual bool GetBlocksToPlace(cWorld &a_World, cPlayer &a_Player, const cItem &a_EquippedItem, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, sSetBlockVector &a_BlocksToSet)
Called from OnPlayerPlace() to determine the blocks that the current placement operation should set...
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
virtual bool OnDiggingBlock(cWorld *a_World, cPlayer *a_Player, const cItem &a_HeldItem, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace)
Called while the player digs a block using this item.
virtual void OnFoodEaten(cWorld *a_World, cPlayer *a_Player, cItem *a_Item)
Called after the player has eaten this item.
virtual ~cItemHandler()
Force virtual destructor.
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld...
virtual FoodInfo GetFoodInfo(const cItem *a_Item)
Returns the FoodInfo for this item.
static cItemHandler * m_ItemHandler[E_ITEM_LAST+1]
virtual bool IsTool(void)
Indicates if this item is a tool.
virtual bool OnPlayerPlace(cWorld &a_World, cPlayer &a_Player, const cItem &a_EquippedItem, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ)
Called when the player tries to place the item (right mouse button, IsPlaceable() == true)...
virtual void OnUpdate(cWorld *a_World, cPlayer *a_Player, const cItem &a_Item)
Called every tick while the item is on the player's inventory (used by maps, for example) - For now...
virtual bool GetPlacementBlockTypeMeta(cWorld *a_World, cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta)
Called when the player right-clicks with this item and IsPlaceable() == true, and OnPlayerPlace() is ...
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
virtual bool IsPlaceable(void)
Blocks simply get placed.
virtual bool IsDrinkable(short a_ItemDamage)
Indicates if this item is drinkable.
virtual void OnEntityAttack(cPlayer *a_Attacker, cEntity *a_AttackedEntity)
Called when a player attacks a other entity.
eDurabilityLostAction
Actions that may cause durability of an item may be lost, where the magnitude of the loss depends on ...
virtual bool IsFood(void)
Indicates if this item is food.
FoodInfo(int a_FoodLevel, double a_Saturation)
cItemHandler * ItemHandler(int a_ItemType)
std::vector< sSetBlock > sSetBlockVector
virtual bool EatItem(cPlayer *a_Player, cItem *a_Item)
Lets the player eat a selected item.