diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:45:45 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:50:18 +0100 |
commit | ca6ef58b1ee8521e4b940ee4883dee714960e413 (patch) | |
tree | 8532add455224b07c07a759e3d906f50c0695888 /src/Items/ItemBow.h | |
parent | Merge pull request #2972 from marvinkopf/PlayerAutoComplete (diff) | |
download | cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2 cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.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(); } |