Enchantments: API and sending to client
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1539 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user