summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-08-18 12:29:54 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2017-08-18 12:29:54 +0200
commitb8dda388e0cf300f573d411dc670099e56c2e3c3 (patch)
tree6c3f40beb7a652f9c5afa560954e68a53db54401 /src/WorldStorage/NBTChunkSerializer.cpp
parentChanged type of FastRandom in monster drop calculation. (#3920) (diff)
downloadcuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.gz
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.bz2
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.lz
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.xz
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.zst
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.zip
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index d474f59e1..480558fa3 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -107,7 +107,7 @@ void cNBTChunkSerializer::AddItem(const cItem & a_Item, int a_Slot, const AStrin
((a_Item.m_ItemType == E_ITEM_FIREWORK_ROCKET) || (a_Item.m_ItemType == E_ITEM_FIREWORK_STAR)) ||
(a_Item.m_RepairCost > 0) ||
(a_Item.m_CustomName != "") ||
- (a_Item.m_Lore != "")
+ (!a_Item.m_LoreTable.empty())
)
{
m_Writer.BeginCompound("tag");
@@ -116,16 +116,23 @@ void cNBTChunkSerializer::AddItem(const cItem & a_Item, int a_Slot, const AStrin
m_Writer.AddInt("RepairCost", a_Item.m_RepairCost);
}
- if ((a_Item.m_CustomName != "") || (a_Item.m_Lore != ""))
+ if ((a_Item.m_CustomName != "") || (!a_Item.m_LoreTable.empty()))
{
m_Writer.BeginCompound("display");
if (a_Item.m_CustomName != "")
{
m_Writer.AddString("Name", a_Item.m_CustomName);
}
- if (a_Item.m_Lore != "")
+ if (!a_Item.m_LoreTable.empty())
{
- m_Writer.AddString("Lore", a_Item.m_Lore);
+ m_Writer.BeginList("Lore", TAG_String);
+
+ for (const auto & Line : a_Item.m_LoreTable)
+ {
+ m_Writer.AddString("", Line);
+ }
+
+ m_Writer.EndList();
}
m_Writer.EndCompound();
}