diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2016-02-06 11:37:34 +0100 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2016-02-06 11:37:34 +0100 |
commit | 6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch) | |
tree | 7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/Items/ItemBow.h | |
parent | Merge pull request #2958 from LogicParrot/fence (diff) | |
parent | Bulk clearing of whitespace (diff) | |
download | cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2 cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip |
Diffstat (limited to 'src/Items/ItemBow.h')
-rw-r--r-- | src/Items/ItemBow.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index 8bbaa3d8c..fc0ee8434 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -19,22 +19,22 @@ class cItemBowHandler : public cItemHandler { typedef cItemHandler super; - + public: cItemBowHandler(void) : super(E_ITEM_BOW) { } - - + + 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 ) override { ASSERT(a_Player != nullptr); - + // Check if the player has an arrow in the inventory, or is in Creative: if (!(a_Player->IsGameModeCreative() || a_Player->GetInventory().HasItems(cItem(E_ITEM_ARROW)))) { @@ -45,8 +45,8 @@ public: return true; } - - + + virtual void OnItemShoot(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override { // Actual shot - produce the arrow with speed based on the ticks that the bow was charged @@ -98,7 +98,7 @@ public: { Arrow->SetPickupState(cArrowEntity::psNoPickup); } - + a_Player->UseEquippedItem(); } |