diff options
author | Mattes D <github@xoft.cz> | 2020-04-21 22:19:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 22:19:22 +0200 |
commit | 487f9a2aa9b5497495cef1ac3b9c7a603e69f862 (patch) | |
tree | 054a846942f414060e29c72f4a717c8a89e70893 /src/Items/ItemPotion.h | |
parent | Delet SpawnObject params (diff) | |
download | cuberite-487f9a2aa9b5497495cef1ac3b9c7a603e69f862.tar cuberite-487f9a2aa9b5497495cef1ac3b9c7a603e69f862.tar.gz cuberite-487f9a2aa9b5497495cef1ac3b9c7a603e69f862.tar.bz2 cuberite-487f9a2aa9b5497495cef1ac3b9c7a603e69f862.tar.lz cuberite-487f9a2aa9b5497495cef1ac3b9c7a603e69f862.tar.xz cuberite-487f9a2aa9b5497495cef1ac3b9c7a603e69f862.tar.zst cuberite-487f9a2aa9b5497495cef1ac3b9c7a603e69f862.zip |
Diffstat (limited to 'src/Items/ItemPotion.h')
-rw-r--r-- | src/Items/ItemPotion.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/Items/ItemPotion.h b/src/Items/ItemPotion.h index 49fbfa0dd..875fbec02 100644 --- a/src/Items/ItemPotion.h +++ b/src/Items/ItemPotion.h @@ -17,6 +17,9 @@ public: } + + + // cItemHandler overrides: virtual bool IsDrinkable(short a_ItemDamage) override { @@ -26,12 +29,19 @@ public: } + + + 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 + cWorld * a_World, + cPlayer * a_Player, + cBlockPluginInterface & a_PluginInterface, + const cItem & a_HeldItem, + const Vector3i a_ClickedBlockPos, + eBlockFace a_ClickedBlockFace ) override { - short PotionDamage = a_Item.m_ItemDamage; + short PotionDamage = a_HeldItem.m_ItemDamage; // Do not throw non-splash potions: if (cEntityEffect::IsPotionDrinkable(PotionDamage)) @@ -59,6 +69,9 @@ public: } + + + virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override { short PotionDamage = a_Item->m_ItemDamage; |