summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-27 21:39:39 +0200
committerMattes D <github@xoft.cz>2014-07-27 21:39:39 +0200
commit0814a977f8a99fb776a73b44bff14b2a6fb11059 (patch)
treeedd7271430e1c0204808b3c12b7735959677b733 /src/Items/ItemHandler.h
parentNetherClumpGenerator: Fixed generating stuff on halfslabs and fences (diff)
parentDerp. (diff)
downloadcuberite-0814a977f8a99fb776a73b44bff14b2a6fb11059.tar
cuberite-0814a977f8a99fb776a73b44bff14b2a6fb11059.tar.gz
cuberite-0814a977f8a99fb776a73b44bff14b2a6fb11059.tar.bz2
cuberite-0814a977f8a99fb776a73b44bff14b2a6fb11059.tar.lz
cuberite-0814a977f8a99fb776a73b44bff14b2a6fb11059.tar.xz
cuberite-0814a977f8a99fb776a73b44bff14b2a6fb11059.tar.zst
cuberite-0814a977f8a99fb776a73b44bff14b2a6fb11059.zip
Diffstat (limited to 'src/Items/ItemHandler.h')
-rw-r--r--src/Items/ItemHandler.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h
index c7362c5f4..1d5f59f3e 100644
--- a/src/Items/ItemHandler.h
+++ b/src/Items/ItemHandler.h
@@ -19,6 +19,13 @@ class cPlayer;
class cItemHandler
{
public:
+
+ enum eDurabilityLostAction
+ {
+ dlaBreakBlock,
+ dlaAttackEntity,
+ };
+
cItemHandler(int a_ItemType);
/** Force virtual destructor */
@@ -48,11 +55,17 @@ public:
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 when the player destroys a block using this item. This also calls the drop function for the destroyed block */
- virtual void OnBlockDestroyed(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_X, int a_Y, int a_Z);
+ virtual void OnBlockDestroyed(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ);
+
+ /** Called when a player attacks a other entity. */
+ virtual void OnEntityAttack(cPlayer * a_Attacker, cEntity * a_AttackedEntity);
/** Called after the player has eaten this item. */
virtual void OnFoodEaten(cWorld *a_World, cPlayer *a_Player, cItem *a_Item);
-
+
+ /** Get the durability lost which the item will get, when a specified action was performed. */
+ virtual short GetDurabilityLossByAction(eDurabilityLostAction a_Action);
+
/** Returns the maximum stack size for a given item */
virtual char GetMaxStackSize(void);