diff options
author | Mattes D <github@xoft.cz> | 2014-09-13 17:05:59 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-09-13 17:05:59 +0200 |
commit | 5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b (patch) | |
tree | fcf2f5efe358c8c9ab7e3f54bc3a95a257e9f899 /src/Items/ItemMushroomSoup.h | |
parent | Gittip is now Gratipay (diff) | |
parent | Added extra mushroom handler. (diff) | |
download | cuberite-5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b.tar cuberite-5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b.tar.gz cuberite-5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b.tar.bz2 cuberite-5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b.tar.lz cuberite-5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b.tar.xz cuberite-5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b.tar.zst cuberite-5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemMushroomSoup.h | 53 |
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; + } + +}; + + + + |