summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.cpp
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/ItemHandler.cpp
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/ItemHandler.cpp')
-rw-r--r--src/Items/ItemHandler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index e425be627..8dc346e53 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:
@@ -634,7 +635,10 @@ bool cItemHandler::GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_Eff
bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item)
{
UNUSED(a_Item);
- a_Player->GetInventory().RemoveOneEquippedItem();
+ if (!a_Player->IsGameModeCreative())
+ {
+ a_Player->GetInventory().RemoveOneEquippedItem();
+ }
FoodInfo Info = GetFoodInfo();
if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f))