diff options
author | Lane Kolbly <lane@rscheme.org> | 2017-07-30 19:53:21 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2017-07-30 19:53:21 +0200 |
commit | 10d42a2452e19ca98506df4d85c0e8f37b3e8981 (patch) | |
tree | 84ab60be36919dac3b24e7384bfd533349a9d177 /src/Items/ItemGoldenApple.h | |
parent | cParsedNBT: Improved error reporting (#3876) (diff) | |
download | cuberite-10d42a2452e19ca98506df4d85c0e8f37b3e8981.tar cuberite-10d42a2452e19ca98506df4d85c0e8f37b3e8981.tar.gz cuberite-10d42a2452e19ca98506df4d85c0e8f37b3e8981.tar.bz2 cuberite-10d42a2452e19ca98506df4d85c0e8f37b3e8981.tar.lz cuberite-10d42a2452e19ca98506df4d85c0e8f37b3e8981.tar.xz cuberite-10d42a2452e19ca98506df4d85c0e8f37b3e8981.tar.zst cuberite-10d42a2452e19ca98506df4d85c0e8f37b3e8981.zip |
Diffstat (limited to 'src/Items/ItemGoldenApple.h')
-rw-r--r-- | src/Items/ItemGoldenApple.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h index c6bd7e470..a88d3eb54 100644 --- a/src/Items/ItemGoldenApple.h +++ b/src/Items/ItemGoldenApple.h @@ -20,9 +20,10 @@ public: virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override { - // Feed the player: - FoodInfo Info = GetFoodInfo(); - a_Player->Feed(Info.FoodLevel, Info.Saturation); + if (!super::EatItem(a_Player, a_Item)) + { + return false; + } // Add the effects: a_Player->AddEntityEffect(cEntityEffect::effAbsorption, 2400, 0); @@ -36,22 +37,16 @@ public: a_Player->AddEntityEffect(cEntityEffect::effFireResistance, 6000, 0); } - a_Player->GetInventory().RemoveOneEquippedItem(); return true; } - virtual FoodInfo GetFoodInfo(void) override + virtual FoodInfo GetFoodInfo(const cItem * a_Item) override { + UNUSED(a_Item); return FoodInfo(4, 9.6); } - - virtual bool GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_EffectDurationTicks, short & a_EffectIntensity, float & a_Chance) override - { - return false; - } - }; |