summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemGoldenApple.h
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2017-07-30 19:53:21 +0200
committerworktycho <work.tycho@gmail.com>2017-07-30 19:53:21 +0200
commit10d42a2452e19ca98506df4d85c0e8f37b3e8981 (patch)
tree84ab60be36919dac3b24e7384bfd533349a9d177 /src/Items/ItemGoldenApple.h
parentcParsedNBT: Improved error reporting (#3876) (diff)
downloadcuberite-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 '')
-rw-r--r--src/Items/ItemGoldenApple.h17
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;
- }
-
};