01-14-2014, 03:15 AM
I have no idea what I"m doing wrong. I"m trying to get custom item names in MCServer but the client keeps disconnecting when I spawn an item with a custom name. This is the code I use:
I used this as for information on how to do the nbt structure:
if (a_Item.m_CustomName != "")
{
// Send the custom item name.
cFastNBTWriter CustomName;
CustomName.BeginCompound("display");
CustomName.AddString("Name", a_Item.m_CustomName);
CustomName.EndCompound();
CustomName.Finish();
AString CustomNameData;
CompressStringGZIP(CustomName.GetResult().data(), CustomName.GetResult().size(), CustomNameData);
WriteShort(CustomNameData.size());
WriteBuf(CustomNameData.data(), CustomNameData.size());
}
I used this as for information on how to do the nbt structure:

