summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemMushroomSoup.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-12 19:34:19 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-12 19:34:19 +0200
commit96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94 (patch)
treea7ec870126b1b38ba327e8224a5955b46edd9e72 /src/Items/ItemMushroomSoup.h
parentMerge branch 'master' into Effects (diff)
downloadcuberite-96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94.tar
cuberite-96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94.tar.gz
cuberite-96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94.tar.bz2
cuberite-96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94.tar.lz
cuberite-96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94.tar.xz
cuberite-96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94.tar.zst
cuberite-96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94.zip
Diffstat (limited to 'src/Items/ItemMushroomSoup.h')
-rw-r--r--src/Items/ItemMushroomSoup.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/Items/ItemMushroomSoup.h b/src/Items/ItemMushroomSoup.h
new file mode 100644
index 000000000..dba313ec5
--- /dev/null
+++ b/src/Items/ItemMushroomSoup.h
@@ -0,0 +1,53 @@
+
+#pragma once
+
+#include "ItemHandler.h"
+
+
+
+
+
+class cItemMushroomSoupHandler :
+ public cItemHandler
+{
+ typedef cItemHandler super;
+
+public:
+ cItemMushroomSoupHandler(int a_ItemType)
+ : super(a_ItemType)
+ {
+ }
+
+
+ virtual bool IsFood(void) override
+ {
+ return true;
+ }
+
+
+ virtual FoodInfo GetFoodInfo(void) override
+ {
+ return FoodInfo(6, 7.2);
+ }
+
+
+ virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
+ {
+ if (!super::EatItem(a_Player, a_Item))
+ {
+ return false;
+ }
+
+ // Return a bowl to the inventory
+ if (!a_Player->IsGameModeCreative())
+ {
+ a_Player->GetInventory().AddItem(cItem(E_ITEM_BOWL), true, true);
+ }
+ return true;
+ }
+
+};
+
+
+
+