diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-02 12:40:20 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-02 12:40:20 +0200 |
commit | a19a0701211e0a5563dc77845e11a3f3308e2b32 (patch) | |
tree | e7ffbd81402a008a2dc8234fef39f53e31d97f03 /source/WorldStorage | |
parent | StringUtils: Fixed the HexDump in DEBUG mode (diff) | |
download | cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.gz cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.bz2 cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.lz cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.xz cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.zst cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.zip |
Diffstat (limited to 'source/WorldStorage')
-rw-r--r-- | source/WorldStorage/NBTChunkSerializer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/WorldStorage/NBTChunkSerializer.cpp b/source/WorldStorage/NBTChunkSerializer.cpp index 65153c4d8..2cf34a24f 100644 --- a/source/WorldStorage/NBTChunkSerializer.cpp +++ b/source/WorldStorage/NBTChunkSerializer.cpp @@ -68,6 +68,16 @@ void cNBTChunkSerializer::AddItem(const cItem & a_Item, int a_Slot, const AStrin {
m_Writer.AddByte ("Slot", (unsigned char)a_Slot);
}
+
+ // Write the enchantments:
+ if (!a_Item.m_Enchantments.IsEmpty())
+ {
+ const char * TagName = (a_Item.m_ItemType == E_ITEM_BOOK) ? "StoredEnchantments" : "ench";
+ m_Writer.BeginCompound("tag");
+ a_Item.m_Enchantments.WriteToNBTCompound(m_Writer, TagName);
+ m_Writer.EndCompound();
+ }
+
m_Writer.EndCompound();
}
|