summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-09-03 08:21:08 +0200
committerarchshift <admin@archshift.com>2014-09-03 08:21:08 +0200
commit34d6f0713e94b5cb3424be6ed3374afaeca5526b (patch)
tree202e99e8d7e0f222d62e6fc7c6403b2853d12805
parentEntityEffect.cpp: Enable 1.8's leaping potion (diff)
downloadcuberite-34d6f0713e94b5cb3424be6ed3374afaeca5526b.tar
cuberite-34d6f0713e94b5cb3424be6ed3374afaeca5526b.tar.gz
cuberite-34d6f0713e94b5cb3424be6ed3374afaeca5526b.tar.bz2
cuberite-34d6f0713e94b5cb3424be6ed3374afaeca5526b.tar.lz
cuberite-34d6f0713e94b5cb3424be6ed3374afaeca5526b.tar.xz
cuberite-34d6f0713e94b5cb3424be6ed3374afaeca5526b.tar.zst
cuberite-34d6f0713e94b5cb3424be6ed3374afaeca5526b.zip
Diffstat (limited to '')
-rw-r--r--src/BlockID.h2
-rw-r--r--src/Items/ItemFood.h2
-rw-r--r--src/Items/ItemHandler.cpp2
-rw-r--r--src/Mobs/Sheep.cpp7
4 files changed, 13 insertions, 0 deletions
diff --git a/src/BlockID.h b/src/BlockID.h
index 08c576886..1565fee49 100644
--- a/src/BlockID.h
+++ b/src/BlockID.h
@@ -362,6 +362,8 @@ enum ENUM_ITEM_ID
E_ITEM_LEAD = 420,
E_ITEM_NAME_TAG = 421,
E_ITEM_MINECART_WITH_COMMAND_BLOCK = 422,
+ E_ITEM_RAW_MUTTON = 423,
+ E_ITEM_MUTTON = 424,
// Keep these two as the last values of the consecutive list, without a number - they will get their correct number assigned automagically by C++
// IsValidItem() depends on this!
diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h
index 98050cad8..c7e7ef2ca 100644
--- a/src/Items/ItemFood.h
+++ b/src/Items/ItemFood.h
@@ -47,10 +47,12 @@ public:
case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2);
case E_ITEM_RAW_FISH: return FoodInfo(2, 1.2);
case E_ITEM_RAW_PORKCHOP: return FoodInfo(3, 1.8);
+ case E_ITEM_RAW_MUTTON: return FoodInfo(2, 1.2);
case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4);
case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8);
case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2);
case E_ITEM_STEAK: return FoodInfo(8, 12.8);
+ case E_ITEM_MUTTON: return FoodInfo(6, 9.6);
}
LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType);
return FoodInfo(0, 0.f);
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index bceedaf69..45a779ade 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -223,10 +223,12 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType)
case E_ITEM_RAW_CHICKEN:
case E_ITEM_RAW_FISH:
case E_ITEM_RAW_PORKCHOP:
+ case E_ITEM_RAW_MUTTON:
case E_ITEM_RED_APPLE:
case E_ITEM_ROTTEN_FLESH:
case E_ITEM_SPIDER_EYE:
case E_ITEM_STEAK:
+ case E_ITEM_MUTTON:
{
return new cItemFoodHandler(a_ItemType);
}
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index 9fb47201d..3be688b43 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -39,6 +39,13 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
a_Drops.push_back(cItem(E_BLOCK_WOOL, 1, m_WoolColor));
}
+
+ int LootingLevel = 0;
+ if (a_Killer != NULL)
+ {
+ LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
+ }
+ AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_MUTTON : E_ITEM_RAW_MUTTON);
}