diff options
author | Mattes D <github@xoft.cz> | 2014-01-19 22:50:50 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-01-19 22:50:50 +0100 |
commit | 865016abe2d879a00b93945dc4984341191995db (patch) | |
tree | 1833001d20b08a20dde0e56d59e0515827ab296e /src/Protocol | |
parent | Merge pull request #565 from mc-server/commandblockfixes (diff) | |
parent | Switched EnchantmentSerilizer to namespace (diff) | |
download | cuberite-865016abe2d879a00b93945dc4984341191995db.tar cuberite-865016abe2d879a00b93945dc4984341191995db.tar.gz cuberite-865016abe2d879a00b93945dc4984341191995db.tar.bz2 cuberite-865016abe2d879a00b93945dc4984341191995db.tar.lz cuberite-865016abe2d879a00b93945dc4984341191995db.tar.xz cuberite-865016abe2d879a00b93945dc4984341191995db.tar.zst cuberite-865016abe2d879a00b93945dc4984341191995db.zip |
Diffstat (limited to 'src/Protocol')
-rw-r--r-- | src/Protocol/Protocol132.cpp | 5 | ||||
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/Protocol/Protocol132.cpp b/src/Protocol/Protocol132.cpp index 29fbb4bba..b4ca37d37 100644 --- a/src/Protocol/Protocol132.cpp +++ b/src/Protocol/Protocol132.cpp @@ -16,6 +16,7 @@ #include "../UI/Window.h" #include "../Entities/Pickup.h" #include "../WorldStorage/FastNBT.h" +#include "../WorldStorage/EnchantmentSerializer.h" #include "../StringCompression.h" #ifdef _MSC_VER @@ -763,7 +764,7 @@ void cProtocol132::WriteItem(const cItem & a_Item) // Send the enchantments: cFastNBTWriter Writer; const char * TagName = (a_Item.m_ItemType == E_ITEM_BOOK) ? "StoredEnchantments" : "ench"; - a_Item.m_Enchantments.WriteToNBTCompound(Writer, TagName); + EnchantmentSerializer::WriteToNBTCompound(a_Item.m_Enchantments, Writer, TagName); Writer.Finish(); AString Compressed; CompressStringGZIP(Writer.GetResult().data(), Writer.GetResult().size(), Compressed); @@ -849,7 +850,7 @@ int cProtocol132::ParseItemMetadata(cItem & a_Item, const AString & a_Metadata) ) ) { - a_Item.m_Enchantments.ParseFromNBT(NBT, tag); + EnchantmentSerializer::ParseFromNBT(a_Item.m_Enchantments, NBT, tag); } } diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 293f96186..e5a380f8a 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -16,6 +16,7 @@ Implements the 1.7.x protocol classes: #include "../Server.h" #include "../World.h" #include "../WorldStorage/FastNBT.h" +#include "../WorldStorage/EnchantmentSerializer.h" #include "../StringCompression.h" #include "../Entities/ExpOrb.h" #include "../Entities/Minecart.h" @@ -1719,7 +1720,7 @@ void cProtocol172::ParseItemMetadata(cItem & a_Item, const AString & a_Metadata) ) ) { - a_Item.m_Enchantments.ParseFromNBT(NBT, tag); + EnchantmentSerializer::ParseFromNBT(a_Item.m_Enchantments, NBT, tag); } else if ((NBT.GetType(tag) == TAG_Compound) && (NBT.GetName(tag) == "display")) // Custom name and lore tag { @@ -1804,7 +1805,7 @@ void cProtocol172::cPacketizer::WriteItem(const cItem & a_Item) if (!a_Item.m_Enchantments.IsEmpty()) { const char * TagName = (a_Item.m_ItemType == E_ITEM_BOOK) ? "StoredEnchantments" : "ench"; - a_Item.m_Enchantments.WriteToNBTCompound(Writer, TagName); + EnchantmentSerializer::WriteToNBTCompound(a_Item.m_Enchantments,Writer, TagName); } if (!a_Item.IsBothNameAndLoreEmpty()) { |