summaryrefslogtreecommitdiffstats
path: root/source/Items/ItemHandler.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-30 14:24:03 +0200
committermadmaxoft <github@xoft.cz>2013-08-30 14:24:03 +0200
commit17ad4c2610f2c33d5b4a8b42b7d4b8fbda9ade32 (patch)
treefeaaf5bf652bfdc542dee9b9c452391531aee6ba /source/Items/ItemHandler.h
parentImplemented basic physics for projectiles. (diff)
downloadcuberite-17ad4c2610f2c33d5b4a8b42b7d4b8fbda9ade32.tar
cuberite-17ad4c2610f2c33d5b4a8b42b7d4b8fbda9ade32.tar.gz
cuberite-17ad4c2610f2c33d5b4a8b42b7d4b8fbda9ade32.tar.bz2
cuberite-17ad4c2610f2c33d5b4a8b42b7d4b8fbda9ade32.tar.lz
cuberite-17ad4c2610f2c33d5b4a8b42b7d4b8fbda9ade32.tar.xz
cuberite-17ad4c2610f2c33d5b4a8b42b7d4b8fbda9ade32.tar.zst
cuberite-17ad4c2610f2c33d5b4a8b42b7d4b8fbda9ade32.zip
Diffstat (limited to '')
-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
};