summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 3c9da6de7..08ed893f5 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -81,6 +81,18 @@ void cNBTChunkSerializer::Finish(void)
memset(m_BlockLight, 0, sizeof(m_BlockLight));
memset(m_BlockSkyLight, 0, sizeof(m_BlockSkyLight));
}
+
+ // Check if "Entity" and "TileEntities" lists exists. MCEdit requires this.
+ if (!m_HasHadEntity)
+ {
+ m_Writer.BeginList("Entities", TAG_Compound);
+ m_Writer.EndList();
+ }
+ if (!m_HasHadBlockEntity)
+ {
+ m_Writer.BeginList("TileEntities", TAG_Compound);
+ m_Writer.EndList();
+ }
}
@@ -765,6 +777,22 @@ void cNBTChunkSerializer::LightIsValid(bool a_IsLightValid)
+void cNBTChunkSerializer::HeightMap(const cChunkDef::HeightMap * a_HeightMap)
+{
+ for (int RelX = 0; RelX < cChunkDef::Width; RelX++)
+ {
+ for (int RelZ = 0; RelZ < cChunkDef::Width; RelZ++)
+ {
+ int Height = cChunkDef::GetHeight(*a_HeightMap, RelX, RelZ);
+ m_VanillaHeightMap[(RelZ << 4) | RelX] = Height;
+ }
+ }
+}
+
+
+
+
+
void cNBTChunkSerializer::BiomeData(const cChunkDef::BiomeMap * a_BiomeMap)
{
memcpy(m_Biomes, a_BiomeMap, sizeof(m_Biomes));