summaryrefslogtreecommitdiffstats
path: root/source/WorldStorage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/WorldStorage/WSSAnvil.cpp8
-rw-r--r--source/WorldStorage/WSSCompact.cpp4
-rw-r--r--source/WorldStorage/WorldStorage.cpp12
3 files changed, 12 insertions, 12 deletions
diff --git a/source/WorldStorage/WSSAnvil.cpp b/source/WorldStorage/WSSAnvil.cpp
index f14d4918b..234ddbd20 100644
--- a/source/WorldStorage/WSSAnvil.cpp
+++ b/source/WorldStorage/WSSAnvil.cpp
@@ -113,10 +113,12 @@ bool cWSSAnvil::SaveChunk(const cChunkCoords & a_Chunk)
AString ChunkData;
if (!SaveChunkToData(a_Chunk, ChunkData))
{
+ LOGWARNING("Cannot serialize chunk [%d, %d] into data", a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ);
return false;
}
if (!SetChunkData(a_Chunk, ChunkData))
{
+ LOGWARNING("Cannot store chunk [%d, %d] data", a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ);
return false;
}
@@ -252,6 +254,7 @@ bool cWSSAnvil::SaveChunkToData(const cChunkCoords & a_Chunk, AString & a_Data)
cFastNBTWriter Writer;
if (!SaveChunkToNBT(a_Chunk, Writer))
{
+ LOGWARNING("Cannot save chunk [%d, %d] to NBT", a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ);
return false;
}
Writer.Finish();
@@ -360,7 +363,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT
//*/
m_World->SetChunkData(
- a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ,
+ a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ,
BlockTypes, MetaData,
IsLightValid ? BlockLight : NULL,
IsLightValid ? SkyLight : NULL,
@@ -393,8 +396,9 @@ bool cWSSAnvil::SaveChunkToNBT(const cChunkCoords & a_Chunk, cFastNBTWriter & a_
a_Writer.AddInt("xPos", a_Chunk.m_ChunkX);
a_Writer.AddInt("zPos", a_Chunk.m_ChunkZ);
cNBTChunkSerializer Serializer(a_Writer);
- if (!m_World->GetChunkData(a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ, Serializer))
+ if (!m_World->GetChunkData(a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, Serializer))
{
+ LOGWARNING("Cannot get chunk [%d, %d] data for NBT saving", a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ);
return false;
}
Serializer.Finish(); // Close NBT tags
diff --git a/source/WorldStorage/WSSCompact.cpp b/source/WorldStorage/WSSCompact.cpp
index 1d873add6..a4acd0b93 100644
--- a/source/WorldStorage/WSSCompact.cpp
+++ b/source/WorldStorage/WSSCompact.cpp
@@ -875,7 +875,7 @@ bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int & a_Uncomp
NIBBLETYPE * SkyLight = (NIBBLETYPE *)(BlockData + cChunkDef::SkyLightOffset);
a_World->SetChunkData(
- a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ,
+ a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ,
BlockData, MetaData,
IsLightValid ? BlockLight : NULL,
IsLightValid ? SkyLight : NULL,
@@ -919,7 +919,7 @@ bool cWSSCompact::cPAKFile::SaveChunkToData(const cChunkCoords & a_Chunk, cWorld
{
// Serialize the chunk:
cJsonChunkSerializer Serializer;
- if (!a_World->GetChunkData(a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ, Serializer))
+ if (!a_World->GetChunkData(a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, Serializer))
{
// Chunk not valid
LOG("cWSSCompact: Trying to save chunk [%d, %d, %d] that has no data, ignoring request.", a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ);
diff --git a/source/WorldStorage/WorldStorage.cpp b/source/WorldStorage/WorldStorage.cpp
index 536dc05d8..1193a7128 100644
--- a/source/WorldStorage/WorldStorage.cpp
+++ b/source/WorldStorage/WorldStorage.cpp
@@ -349,16 +349,12 @@ bool cWorldStorage::SaveOneChunk(void)
LOGINFO("Saved all chunks in world %s", m_World->GetName().c_str());
return HasMore;
}
- if (ShouldSave && m_World->IsChunkValid(Save.m_ChunkX, Save.m_ChunkY, Save.m_ChunkZ))
+ if (ShouldSave && m_World->IsChunkValid(Save.m_ChunkX, Save.m_ChunkZ))
{
- m_World->MarkChunkSaving(Save.m_ChunkX, Save.m_ChunkY, Save.m_ChunkZ);
+ m_World->MarkChunkSaving(Save.m_ChunkX, Save.m_ChunkZ);
if (m_SaveSchema->SaveChunk(Save))
{
- m_World->MarkChunkSaved(Save.m_ChunkX, Save.m_ChunkY, Save.m_ChunkZ);
- }
- else
- {
- LOGWARNING("Cannot save chunk [%d, %d, %d]", Save.m_ChunkX, Save.m_ChunkY, Save.m_ChunkZ);
+ m_World->MarkChunkSaved(Save.m_ChunkX, Save.m_ChunkZ);
}
}
return HasMore;
@@ -370,7 +366,7 @@ bool cWorldStorage::SaveOneChunk(void)
bool cWorldStorage::LoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
{
- if (m_World->IsChunkValid(a_ChunkX, a_ChunkY, a_ChunkZ))
+ if (m_World->IsChunkValid(a_ChunkX, a_ChunkZ))
{
// Already loaded (can happen, since the queue is async)
return true;