summaryrefslogtreecommitdiffstats
path: root/source/Items/ItemHandler.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-30 14:32:07 +0200
committermadmaxoft <github@xoft.cz>2013-08-30 14:32:07 +0200
commitc28ccdc9d56497d42c2a97554a96de76e0d2ee68 (patch)
treef1a1f5629ae7e2565330580ab4e6fe76466acf6e /source/Items/ItemHandler.h
parentAdded the login sequence of a vanilla client to the docs. (diff)
parentShooting a bow kinda works. (diff)
downloadcuberite-c28ccdc9d56497d42c2a97554a96de76e0d2ee68.tar
cuberite-c28ccdc9d56497d42c2a97554a96de76e0d2ee68.tar.gz
cuberite-c28ccdc9d56497d42c2a97554a96de76e0d2ee68.tar.bz2
cuberite-c28ccdc9d56497d42c2a97554a96de76e0d2ee68.tar.lz
cuberite-c28ccdc9d56497d42c2a97554a96de76e0d2ee68.tar.xz
cuberite-c28ccdc9d56497d42c2a97554a96de76e0d2ee68.tar.zst
cuberite-c28ccdc9d56497d42c2a97554a96de76e0d2ee68.zip
Diffstat (limited to 'source/Items/ItemHandler.h')
-rw-r--r--source/Items/ItemHandler.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/Items/ItemHandler.h b/source/Items/ItemHandler.h
index 44d43e8f7..e39bb054b 100644
--- a/source/Items/ItemHandler.h
+++ b/source/Items/ItemHandler.h
@@ -21,8 +21,11 @@ class cItemHandler
public:
cItemHandler(int a_ItemType);
- /// Called when the player tries to use the item. Return false to make the item unusable. DEFAULT: False
- virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir); //eg for fishing or hoes
+ /// Called when the player tries to use the item (right mouse button). Return false to make the item unusable. DEFAULT: False
+ virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir);
+
+ /// Called when the client sends the SHOOT status in the lclk packet
+ virtual void OnItemShoot(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace) {}
/// Called while the player diggs a block using this item
virtual bool OnDiggingBlock(cWorld * a_World, cPlayer * a_Player, const cItem & a_HeldItem, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace);
@@ -88,7 +91,7 @@ protected:
int m_ItemType;
static cItemHandler *CreateItemHandler(int m_ItemType);
- static cItemHandler *m_ItemHandler[2268];
+ static cItemHandler * m_ItemHandler[E_ITEM_LAST + 1];
static bool m_HandlerInitialized; //used to detect if the itemhandlers are initialized
};