diff options
author | andrew <xdotftw@gmail.com> | 2014-01-23 15:42:01 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-01-23 15:42:01 +0100 |
commit | 5c04e216eb16a899719511c97ffb6139b2259c01 (patch) | |
tree | 4c9207d122ba756de32322b2529404287cd82d78 /src | |
parent | Fixed scoreboard serialization (diff) | |
download | cuberite-5c04e216eb16a899719511c97ffb6139b2259c01.tar cuberite-5c04e216eb16a899719511c97ffb6139b2259c01.tar.gz cuberite-5c04e216eb16a899719511c97ffb6139b2259c01.tar.bz2 cuberite-5c04e216eb16a899719511c97ffb6139b2259c01.tar.lz cuberite-5c04e216eb16a899719511c97ffb6139b2259c01.tar.xz cuberite-5c04e216eb16a899719511c97ffb6139b2259c01.tar.zst cuberite-5c04e216eb16a899719511c97ffb6139b2259c01.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/ScoreboardSerializer.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/WorldStorage/ScoreboardSerializer.cpp b/src/WorldStorage/ScoreboardSerializer.cpp index d41456d15..a53971dc2 100644 --- a/src/WorldStorage/ScoreboardSerializer.cpp +++ b/src/WorldStorage/ScoreboardSerializer.cpp @@ -103,7 +103,8 @@ bool cScoreboardSerializer::Save(void) void cScoreboardSerializer::SaveScoreboardToNBT(cFastNBTWriter & a_Writer) { - a_Writer.BeginCompound("Data"); + a_Writer.BeginCompound("data"); + a_Writer.BeginList("Objectives", TAG_Compound); for (cScoreboard::cObjectiveMap::const_iterator it = m_ScoreBoard->m_Objectives.begin(); it != m_ScoreBoard->m_Objectives.end(); ++it) @@ -174,8 +175,6 @@ void cScoreboardSerializer::SaveScoreboardToNBT(cFastNBTWriter & a_Writer) a_Writer.EndList(); // Teams - a_Writer.EndCompound(); // Data - a_Writer.BeginCompound("DisplaySlots"); cObjective * Objective = m_ScoreBoard->GetObjectiveIn(cScoreboard::E_DISPLAY_SLOT_LIST); @@ -188,6 +187,8 @@ void cScoreboardSerializer::SaveScoreboardToNBT(cFastNBTWriter & a_Writer) a_Writer.AddString("slot_2", (Objective == NULL) ? "" : Objective->GetName()); a_Writer.EndCompound(); // DisplaySlots + + a_Writer.EndCompound(); // Data } @@ -196,7 +197,7 @@ void cScoreboardSerializer::SaveScoreboardToNBT(cFastNBTWriter & a_Writer) bool cScoreboardSerializer::LoadScoreboardFromNBT(const cParsedNBT & a_NBT) { - int Data = a_NBT.FindChildByName(0, "Data"); + int Data = a_NBT.FindChildByName(0, "data"); if (Data < 0) { return false; @@ -338,7 +339,7 @@ bool cScoreboardSerializer::LoadScoreboardFromNBT(const cParsedNBT & a_NBT) } } - int DisplaySlots = a_NBT.FindChildByName(0, "DisplaySlots"); + int DisplaySlots = a_NBT.FindChildByName(Data, "DisplaySlots"); if (DisplaySlots < 0) { return false; |