summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-23 16:32:09 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-23 16:32:09 +0200
commit396739cc0faf01a099acbe669c5a9def98d3aaae (patch)
tree91cff4c6ac486b2158edefce878174fe95e2fb3d /src/Items/ItemHandler.h
parentCheckBasicStyle: Added a lua shebang. (diff)
downloadcuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.gz
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.bz2
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.lz
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.xz
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.zst
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.zip
Diffstat (limited to '')
-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..28b1dd13b 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 GetDurabilityLostWithThatAction(eDurabilityLostAction a_Action);
+
/** Returns the maximum stack size for a given item */
virtual char GetMaxStackSize(void);