01-15-2014, 04:55 AM
The following code works for me.
I recommend to add a new class called cCustomNames that stores names and lore, which implements a function to write them all to NBT. I believe it should be basically similar to Enchantments.cpp. Add all the code into cProtocol172::WriteItem(), not forgetting to adapt some code there that only checks for enchanments, and it should be all good
Do correct me if I have no idea what I'm talking about
cFastNBTWriter Writer("tag");
Writer.BeginCompound("display");
Writer.AddString("Name", "SuperDerpy!");
Writer.BeginList("Lore", TAG_String);
Writer.AddString("", "LoOoore!");
Writer.EndList();
Writer.EndCompound();
Writer.Finish();
AString Compressed;
CompressStringGZIP(Writer.GetResult().data(), Writer.GetResult().size(), Compressed);
WriteShort(Compressed.size());
WriteBuf(Compressed.data(), Compressed.size());
I recommend to add a new class called cCustomNames that stores names and lore, which implements a function to write them all to NBT. I believe it should be basically similar to Enchantments.cpp. Add all the code into cProtocol172::WriteItem(), not forgetting to adapt some code there that only checks for enchanments, and it should be all good

Do correct me if I have no idea what I'm talking about

