diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 14:42:35 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 14:42:35 +0100 |
commit | 423f49d175d8db6283232bd8bdc106e26bdcff4d (patch) | |
tree | 5c5cc58d1061c91d2cb39021853ce72ab59839ae /source/WSSCompact.h | |
parent | Chunks are properly saved before being unloaded now (diff) | |
download | cuberite-423f49d175d8db6283232bd8bdc106e26bdcff4d.tar cuberite-423f49d175d8db6283232bd8bdc106e26bdcff4d.tar.gz cuberite-423f49d175d8db6283232bd8bdc106e26bdcff4d.tar.bz2 cuberite-423f49d175d8db6283232bd8bdc106e26bdcff4d.tar.lz cuberite-423f49d175d8db6283232bd8bdc106e26bdcff4d.tar.xz cuberite-423f49d175d8db6283232bd8bdc106e26bdcff4d.tar.zst cuberite-423f49d175d8db6283232bd8bdc106e26bdcff4d.zip |
Diffstat (limited to '')
-rw-r--r-- | source/WSSCompact.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/WSSCompact.h b/source/WSSCompact.h index dc5ecfe9e..a2bfc4d20 100644 --- a/source/WSSCompact.h +++ b/source/WSSCompact.h @@ -37,8 +37,8 @@ protected: cPAKFile(const AString & a_FileName, int a_LayerX, int a_LayerZ);
~cPAKFile();
- bool SaveChunk(const cChunkPtr & a_Chunk);
- bool LoadChunk(const cChunkPtr & a_Chunk);
+ bool SaveChunk(const cChunkCoords & a_Chunk, cWorld * a_World);
+ bool LoadChunk(const cChunkCoords & a_Chunk, cWorld * a_World);
int GetLayerX(void) const {return m_LayerX; }
int GetLayerZ(void) const {return m_LayerZ; }
@@ -54,10 +54,11 @@ protected: int m_NumDirty; // Number of chunks that were written into m_DataContents but not into the file
- bool LoadChunk(const cChunkPtr & a_Chunk, int a_Offset, sChunkHeader * a_Header);
- void EraseChunk(const cChunkPtr & a_Chunk); // Erases the chunk data from m_DataContents and updates m_ChunkHeaders
- bool SaveChunkToData(const cChunkPtr & a_Chunk); // Saves the chunk to m_DataContents, updates headers and m_NumDirty
+ bool LoadChunk(const cChunkCoords & a_Chunk, int a_Offset, sChunkHeader * a_Header, cWorld * a_World);
+ void EraseChunk(const cChunkCoords & a_Chunk); // Erases the chunk data from m_DataContents and updates m_ChunkHeaders
+ bool SaveChunkToData(const cChunkCoords & a_Chunk, cWorld * a_World); // Saves the chunk to m_DataContents, updates headers and m_NumDirty
void SynchronizeFile(void); // Writes m_DataContents along with the headers to file, resets m_NumDirty
+ void LoadEntitiesFromJson(Json::Value & a_Value, cEntityList & a_Entities, cBlockEntityList & a_BlockEntities, cWorld * a_World);
} ;
typedef std::list<cPAKFile *> cPAKFiles;
@@ -65,11 +66,11 @@ protected: cPAKFiles m_PAKFiles; // A MRU cache of PAK files
/// Loads the correct PAK file either from cache or from disk, manages the m_PAKFiles cache
- cPAKFile * LoadPAKFile(const cChunkPtr & a_Chunk);
+ cPAKFile * LoadPAKFile(const cChunkCoords & a_Chunk);
// cWSSchema overrides:
- virtual bool LoadChunk(const cChunkPtr & a_Chunk) override;
- virtual bool SaveChunk(const cChunkPtr & a_Chunk) override;
+ virtual bool LoadChunk(const cChunkCoords & a_Chunk) override;
+ virtual bool SaveChunk(const cChunkCoords & a_Chunk) override;
virtual const AString GetName(void) const override {return "compact"; }
} ;
|