Don't create two entity lists.
This commit is contained in:
parent
65077c314a
commit
1d588b5195
@ -81,6 +81,18 @@ void cNBTChunkSerializer::Finish(void)
|
|||||||
memset(m_BlockLight, 0, sizeof(m_BlockLight));
|
memset(m_BlockLight, 0, sizeof(m_BlockLight));
|
||||||
memset(m_BlockSkyLight, 0, sizeof(m_BlockSkyLight));
|
memset(m_BlockSkyLight, 0, sizeof(m_BlockSkyLight));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if "Entity" and "TileEntities" lists exists. MCEdit requires this.
|
||||||
|
if (!m_HasHadEntity)
|
||||||
|
{
|
||||||
|
a_Writer.BeginList("Entities", TAG_Compound);
|
||||||
|
a_Writer.EndList();
|
||||||
|
}
|
||||||
|
if (!m_HasHadBlockEntity)
|
||||||
|
{
|
||||||
|
a_Writer.BeginList("TileEntities", TAG_Compound);
|
||||||
|
a_Writer.EndList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
#include "../Entities/ItemFrame.h"
|
#include "../Entities/ItemFrame.h"
|
||||||
|
|
||||||
#include "../Protocol/MojangAPI.h"
|
#include "../Protocol/MojangAPI.h"
|
||||||
|
#include "Server.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -99,7 +100,7 @@ cWSSAnvil::cWSSAnvil(cWorld * a_World, int a_CompressionFactor) :
|
|||||||
Writer.BeginCompound("Data");
|
Writer.BeginCompound("Data");
|
||||||
Writer.AddByte("allowCommands", 1);
|
Writer.AddByte("allowCommands", 1);
|
||||||
Writer.AddByte("Difficulty", 2);
|
Writer.AddByte("Difficulty", 2);
|
||||||
Writer.AddByte("hardcore", 0);
|
Writer.AddByte("hardcore", cRoot::Get()->GetServer()->IsHardcore() ? 1 : 0);
|
||||||
Writer.AddByte("initialized", 1);
|
Writer.AddByte("initialized", 1);
|
||||||
Writer.AddByte("MapFeatures", 1);
|
Writer.AddByte("MapFeatures", 1);
|
||||||
Writer.AddByte("raining", a_World->IsWeatherRain() ? 1 : 0);
|
Writer.AddByte("raining", a_World->IsWeatherRain() ? 1 : 0);
|
||||||
@ -457,12 +458,6 @@ bool cWSSAnvil::SaveChunkToNBT(const cChunkCoords & a_Chunk, cFastNBTWriter & a_
|
|||||||
a_Writer.AddInt("xPos", a_Chunk.m_ChunkX);
|
a_Writer.AddInt("xPos", a_Chunk.m_ChunkX);
|
||||||
a_Writer.AddInt("zPos", a_Chunk.m_ChunkZ);
|
a_Writer.AddInt("zPos", a_Chunk.m_ChunkZ);
|
||||||
|
|
||||||
// Add "Entities" and "TileEntities". MCEdit can't load the chunk if one of these lists doesn't exists.
|
|
||||||
a_Writer.BeginList("Entities", TAG_Compound);
|
|
||||||
a_Writer.EndList();
|
|
||||||
a_Writer.BeginList("TileEntities", TAG_Compound);
|
|
||||||
a_Writer.EndList();
|
|
||||||
|
|
||||||
cNBTChunkSerializer Serializer(a_Writer);
|
cNBTChunkSerializer Serializer(a_Writer);
|
||||||
if (!m_World->GetChunkData(a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, Serializer))
|
if (!m_World->GetChunkData(a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, Serializer))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user