diff options
author | Lukas Pioch <lukas@zgow.de> | 2017-05-05 11:58:21 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-05-08 06:30:54 +0200 |
commit | 41bfb22834f0cd13166914b35d4616f21f3c99df (patch) | |
tree | edb3ed8e3ef8b0258d4522a2f3202cc9aa09521d /src/WorldStorage | |
parent | Adjusted RipeMeta for off by one error (#3691) (diff) | |
download | cuberite-41bfb22834f0cd13166914b35d4616f21f3c99df.tar cuberite-41bfb22834f0cd13166914b35d4616f21f3c99df.tar.gz cuberite-41bfb22834f0cd13166914b35d4616f21f3c99df.tar.bz2 cuberite-41bfb22834f0cd13166914b35d4616f21f3c99df.tar.lz cuberite-41bfb22834f0cd13166914b35d4616f21f3c99df.tar.xz cuberite-41bfb22834f0cd13166914b35d4616f21f3c99df.tar.zst cuberite-41bfb22834f0cd13166914b35d4616f21f3c99df.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/NBTChunkSerializer.cpp | 1 | ||||
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 6797d196a..e00e7aa3c 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -205,6 +205,7 @@ void cNBTChunkSerializer::AddBrewingstandEntity(cBrewingstandEntity * a_Brewings AddItemGrid(a_Brewingstand->GetContents()); m_Writer.EndList(); m_Writer.AddShort("BrewTime", a_Brewingstand->GetTimeBrewed()); + m_Writer.AddShort("Fuel", a_Brewingstand->GetRemainingFuel()); m_Writer.EndCompound(); } diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 54ee5b1da..971c6d88c 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -944,6 +944,14 @@ cBlockEntity * cWSSAnvil::LoadBrewingstandFromNBT(const cParsedNBT & a_NBT, int std::unique_ptr<cBrewingstandEntity> Brewingstand(new cBrewingstandEntity(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, m_World)); + // Fuel has to be loaded at first, because of slot events: + int Fuel = a_NBT.FindChildByName(a_TagIdx, "Fuel"); + if (Fuel >= 0) + { + Int16 tb = a_NBT.GetShort(Fuel); + Brewingstand->SetRemainingFuel(tb); + } + // Load slots: for (int Child = a_NBT.GetFirstChild(Items); Child != -1; Child = a_NBT.GetNextSibling(Child)) { @@ -964,11 +972,11 @@ cBlockEntity * cWSSAnvil::LoadBrewingstandFromNBT(const cParsedNBT & a_NBT, int if (BrewTime >= 0) { Int16 tb = a_NBT.GetShort(BrewTime); - Brewingstand->setTimeBrewed(tb); + Brewingstand->SetTimeBrewed(tb); } // Restart brewing: - Brewingstand->GetRecipes(); + Brewingstand->LoadRecipes(); Brewingstand->ContinueBrewing(); return Brewingstand.release(); } |