diff options
author | Lukas Pioch <lukas@zgow.de> | 2017-05-09 14:21:25 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-05-24 19:02:18 +0200 |
commit | 73a3c4e3be1916bdd4830e7ce7454035a1f572f6 (patch) | |
tree | 95716ef6c87706de98866b0fa13f862dd07855ff /src/WorldStorage | |
parent | Off-hand/shield slot functional, save and load slot, bow + arrow functional (#3725) (diff) | |
download | cuberite-73a3c4e3be1916bdd4830e7ce7454035a1f572f6.tar cuberite-73a3c4e3be1916bdd4830e7ce7454035a1f572f6.tar.gz cuberite-73a3c4e3be1916bdd4830e7ce7454035a1f572f6.tar.bz2 cuberite-73a3c4e3be1916bdd4830e7ce7454035a1f572f6.tar.lz cuberite-73a3c4e3be1916bdd4830e7ce7454035a1f572f6.tar.xz cuberite-73a3c4e3be1916bdd4830e7ce7454035a1f572f6.tar.zst cuberite-73a3c4e3be1916bdd4830e7ce7454035a1f572f6.zip |
Diffstat (limited to 'src/WorldStorage')
-rw-r--r-- | src/WorldStorage/NBTChunkSerializer.cpp | 1 | ||||
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index e00e7aa3c..d98fc7bb5 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -421,6 +421,7 @@ void cNBTChunkSerializer::AddBoatEntity(cBoat * a_Boat) { m_Writer.BeginCompound(""); AddBasicEntity(a_Boat, "Boat"); + m_Writer.AddString("Type", cBoat::MaterialToString(a_Boat->GetMaterial())); m_Writer.EndCompound(); } diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 47f08e9cf..1d7cedaa6 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1659,11 +1659,17 @@ void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cBoat> Boat = cpp14::make_unique<cBoat>(0, 0, 0); + std::unique_ptr<cBoat> Boat = cpp14::make_unique<cBoat>(0, 0, 0, cBoat::bmOak); if (!LoadEntityBaseFromNBT(*Boat.get(), a_NBT, a_TagIdx)) { return; } + + int TypeIdx = a_NBT.FindChildByName(a_TagIdx, "Type"); + if (TypeIdx > 0) + { + Boat->SetMaterial(cBoat::StringToMaterial(a_NBT.GetString(TypeIdx))); + } a_Entities.push_back(Boat.release()); } |