summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-09-13 17:05:59 +0200
committerMattes D <github@xoft.cz>2014-09-13 17:05:59 +0200
commit5b63a7fe9864a7b1afdf526a2b3b6d29ed991b9b (patch)
treefcf2f5efe358c8c9ab7e3f54bc3a95a257e9f899 /src/Items/ItemHandler.cpp
parentGittip is now Gratipay (diff)
parentAdded extra mushroom handler. (diff)
downloadcuberite-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 'src/Items/ItemHandler.cpp')
-rw-r--r--src/Items/ItemHandler.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 6ffcc718d..f7882a50f 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -33,6 +33,7 @@
#include "ItemLilypad.h"
#include "ItemMap.h"
#include "ItemMinecart.h"
+#include "ItemMushroomSoup.h"
#include "ItemNetherWart.h"
#include "ItemPainting.h"
#include "ItemPickaxe.h"
@@ -125,6 +126,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType)
case E_BLOCK_LILY_PAD: return new cItemLilypadHandler(a_ItemType);
case E_ITEM_MAP: return new cItemMapHandler();
case E_ITEM_MILK: return new cItemMilkHandler();
+ case E_ITEM_MUSHROOM_SOUP: return new cItemMushroomSoupHandler(a_ItemType);
case E_ITEM_ITEM_FRAME: return new cItemItemFrameHandler(a_ItemType);
case E_ITEM_NETHER_WART: return new cItemNetherWartHandler(a_ItemType);
case E_ITEM_PAINTING: return new cItemPaintingHandler(a_ItemType);
@@ -216,7 +218,6 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType)
case E_ITEM_COOKIE:
case E_ITEM_GOLDEN_CARROT:
case E_ITEM_MELON_SLICE:
- case E_ITEM_MUSHROOM_SOUP:
case E_ITEM_MUTTON:
case E_ITEM_POISONOUS_POTATO:
case E_ITEM_PUMPKIN_PIE:
@@ -635,6 +636,10 @@ bool cItemHandler::GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_Eff
bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item)
{
UNUSED(a_Item);
+ if (!a_Player->IsGameModeCreative())
+ {
+ a_Player->GetInventory().RemoveOneEquippedItem();
+ }
FoodInfo Info = GetFoodInfo();
if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f))