diff options
author | Mattes D <github@xoft.cz> | 2014-09-24 21:15:39 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-09-24 21:15:39 +0200 |
commit | 28676728155f7a98f2a713770e8a15f82726ab47 (patch) | |
tree | 6633ced6077aaa45b2735aec2a6855ce75bb3643 /src/WorldStorage/NBTChunkSerializer.cpp | |
parent | QtBiomeVisualiser: Fixed MSVC path-crossing. (diff) | |
parent | derp (diff) | |
download | cuberite-28676728155f7a98f2a713770e8a15f82726ab47.tar cuberite-28676728155f7a98f2a713770e8a15f82726ab47.tar.gz cuberite-28676728155f7a98f2a713770e8a15f82726ab47.tar.bz2 cuberite-28676728155f7a98f2a713770e8a15f82726ab47.tar.lz cuberite-28676728155f7a98f2a713770e8a15f82726ab47.tar.xz cuberite-28676728155f7a98f2a713770e8a15f82726ab47.tar.zst cuberite-28676728155f7a98f2a713770e8a15f82726ab47.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/NBTChunkSerializer.cpp | 28 |
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)); |