1
0

Represent cItem::m_Lore as an AStringVector (#3882)

* Replace cItem::m_Lore with AStringVector

* Reword deprecation warning

* Fix lua bindings
This commit is contained in:
peterbell10
2017-08-18 11:29:54 +01:00
committed by Tiger Wang
parent 8f1ddfa6c3
commit b8dda388e0
13 changed files with 251 additions and 57 deletions

View File

@@ -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));
}
}
}