summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-05-07 22:18:53 +0200
committerMattes D <github@xoft.cz>2014-05-07 22:18:53 +0200
commitd1b719885da02e917a420b625085e0bd6b9fd70b (patch)
treec8cd2b05be0874aca2f3f5ed572e823ef6c860d9 /src/Protocol
parentMerge pull request #853 from Howaner/Slabs (diff)
parentMissing comma (diff)
downloadcuberite-d1b719885da02e917a420b625085e0bd6b9fd70b.tar
cuberite-d1b719885da02e917a420b625085e0bd6b9fd70b.tar.gz
cuberite-d1b719885da02e917a420b625085e0bd6b9fd70b.tar.bz2
cuberite-d1b719885da02e917a420b625085e0bd6b9fd70b.tar.lz
cuberite-d1b719885da02e917a420b625085e0bd6b9fd70b.tar.xz
cuberite-d1b719885da02e917a420b625085e0bd6b9fd70b.tar.zst
cuberite-d1b719885da02e917a420b625085e0bd6b9fd70b.zip
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol17x.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index bc9aff0c0..f6849122f 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -2278,6 +2278,13 @@ void cProtocol172::ParseItemMetadata(cItem & a_Item, const AString & a_Metadata)
}
break;
}
+ case TAG_Int:
+ {
+ if (TagName == "RepairCost")
+ {
+ a_Item.m_RepairCost = NBT.GetInt(tag);
+ }
+ }
default: LOGD("Unimplemented NBT data when parsing!"); break;
}
}
@@ -2451,6 +2458,10 @@ void cProtocol172::cPacketizer::WriteItem(const cItem & a_Item)
// Send the enchantments and custom names:
cFastNBTWriter Writer;
+ if (a_Item.m_RepairCost != 0)
+ {
+ Writer.AddInt("RepairCost", a_Item.m_RepairCost);
+ }
if (!a_Item.m_Enchantments.IsEmpty())
{
const char * TagName = (a_Item.m_ItemType == E_ITEM_BOOK) ? "StoredEnchantments" : "ench";