summaryrefslogtreecommitdiffstats
path: root/src/Items
diff options
context:
space:
mode:
authorDamián Imrich <damian@haze.sk>2021-04-03 19:45:20 +0200
committerGitHub <noreply@github.com>2021-04-03 19:45:20 +0200
commit071b7be3d4d08c337c01de7abca034e6c3746194 (patch)
treeb878b6df8abe69493d61098610738edb8d95a82b /src/Items
parentFix finisher generating invalid pumpkin (diff)
downloadcuberite-071b7be3d4d08c337c01de7abca034e6c3746194.tar
cuberite-071b7be3d4d08c337c01de7abca034e6c3746194.tar.gz
cuberite-071b7be3d4d08c337c01de7abca034e6c3746194.tar.bz2
cuberite-071b7be3d4d08c337c01de7abca034e6c3746194.tar.lz
cuberite-071b7be3d4d08c337c01de7abca034e6c3746194.tar.xz
cuberite-071b7be3d4d08c337c01de7abca034e6c3746194.tar.zst
cuberite-071b7be3d4d08c337c01de7abca034e6c3746194.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemArmor.h10
-rw-r--r--src/Items/ItemHandler.cpp1
2 files changed, 3 insertions, 8 deletions
diff --git a/src/Items/ItemArmor.h b/src/Items/ItemArmor.h
index d91888d5b..3139c09f4 100644
--- a/src/Items/ItemArmor.h
+++ b/src/Items/ItemArmor.h
@@ -63,14 +63,7 @@ public:
}
a_Player->GetInventory().SetArmorSlot(SlotNum, a_HeldItem.CopyOne());
-
- cItem Item(a_HeldItem);
- Item.m_ItemCount--;
- if (Item.m_ItemCount <= 0)
- {
- Item.Empty();
- }
- a_Player->GetInventory().SetEquippedItem(Item);
+ a_Player->GetInventory().RemoveOneEquippedItem();
return true;
}
@@ -110,6 +103,7 @@ public:
{
return (a_ItemType == E_ITEM_GOLD);
}
+ case E_ITEM_ELYTRA: // TODO: require Phantom Membrane instead of leather starting from protocol version 369 or 1.13 release
case E_ITEM_LEATHER_BOOTS:
case E_ITEM_LEATHER_CAP:
case E_ITEM_LEATHER_PANTS:
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 8c970692f..bfeba1373 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -282,6 +282,7 @@ cItemHandler * cItemHandler::CreateItemHandler(int a_ItemType)
case E_ITEM_RABBIT_STEW: return new cItemSoupHandler(a_ItemType, FoodInfo(10, 12));
// Armor:
+ case E_ITEM_ELYTRA:
case E_ITEM_LEATHER_CAP:
case E_ITEM_GOLD_HELMET:
case E_ITEM_CHAIN_HELMET: