summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.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/WSSAnvil.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/WSSAnvil.cpp')
-rwxr-xr-xsrc/WorldStorage/WSSAnvil.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 14d5738c2..77d1e46b8 100755
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -804,7 +804,17 @@ bool cWSSAnvil::LoadItemFromNBT(cItem & a_Item, const cParsedNBT & a_NBT, int a_
int Lore = a_NBT.FindChildByName(DisplayTag, "Lore");
if ((Lore > 0) && (a_NBT.GetType(Lore) == TAG_String))
{
- a_Item.m_Lore = a_NBT.GetString(Lore);
+ // Legacy string lore
+ a_Item.m_LoreTable = StringSplit(a_NBT.GetString(Lore), "`");
+ }
+ else if ((Lore > 0) && (a_NBT.GetType(Lore) == TAG_List))
+ {
+ // Lore table
+ a_Item.m_LoreTable.clear();
+ for (int loretag = a_NBT.GetFirstChild(Lore); loretag >= 0; loretag = a_NBT.GetNextSibling(loretag)) // Loop through array of strings
+ {
+ a_Item.m_LoreTable.push_back(a_NBT.GetString(loretag));
+ }
}
}