summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemSoup.h
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2020-04-04 17:13:41 +0200
committerGitHub <noreply@github.com>2020-04-04 17:13:41 +0200
commit2b9474f171a4c0e1863b52ea585f145ddaabe404 (patch)
treecadb7c58b7b6f7b10182740b3afe87c1ad7354f1 /src/Items/ItemSoup.h
parentPotion changes (#4601) (diff)
downloadcuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.gz
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.bz2
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.lz
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.xz
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.zst
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.zip
Diffstat (limited to 'src/Items/ItemSoup.h')
-rw-r--r--src/Items/ItemSoup.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Items/ItemSoup.h b/src/Items/ItemSoup.h
new file mode 100644
index 000000000..958c0e0ea
--- /dev/null
+++ b/src/Items/ItemSoup.h
@@ -0,0 +1,39 @@
+
+#pragma once
+
+#include "ItemFood.h"
+#include "../World.h"
+
+
+
+
+
+class cItemSoupHandler :
+ public cItemFoodHandler
+{
+ typedef cItemFoodHandler super;
+
+public:
+ cItemSoupHandler(int a_ItemType, FoodInfo a_FoodInfo) :
+ super(a_ItemType, a_FoodInfo)
+ {
+
+ }
+
+ virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
+ {
+ // Skip over food handler, which does removal for us.
+ if (!cItemHandler::EatItem(a_Player, a_Item))
+ {
+ return false;
+ }
+
+ if (!a_Player->IsGameModeCreative())
+ {
+ a_Player->ReplaceOneEquippedItemTossRest(cItem(E_ITEM_BOWL));
+ }
+
+ return true;
+ }
+
+};