summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-05 14:03:55 +0100
committerGitHub <noreply@github.com>2021-03-05 14:03:55 +0100
commit868cd94ee9a5a0638c014a4cc42224f01ff234c8 (patch)
treecd23dc866f77de5b0b3e89a5eafeeb2ef24ffbdd /src/ChunkMap.h
parentfixed the crash on generating in the SinglePiceStructuresGen (#5136) (diff)
downloadcuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.gz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.bz2
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.lz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.xz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.zst
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkMap.h29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/ChunkMap.h b/src/ChunkMap.h
index de1f29754..bafadc818 100644
--- a/src/ChunkMap.h
+++ b/src/ChunkMap.h
@@ -34,10 +34,11 @@ class cFlowerPotEntity;
class cBlockArea;
class cMobCensus;
class cMobSpawner;
-class cSetChunkData;
class cBoundingBox;
class cDeadlockDetect;
+struct SetChunkData;
+
typedef std::list<cClientHandle *> cClientHandleList;
using cEntityCallback = cFunctionRef<bool(cEntity &)>;
using cBeaconCallback = cFunctionRef<bool(cBeaconEntity &)>;
@@ -65,7 +66,6 @@ class cChunkMap
public:
cChunkMap(cWorld * a_World);
- ~cChunkMap();
/** Sends the block entity, if it is at the coords specified, to a_Client */
void SendBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cClientHandle & a_Client);
@@ -99,7 +99,7 @@ public:
If MarkDirty is set, the chunk is set as dirty (used after generating)
Modifies the BlockEntity list in a_SetChunkData - moves the block entities into the chunk.
*/
- void SetChunkData(cSetChunkData & a_SetChunkData);
+ void SetChunkData(SetChunkData && a_SetChunkData);
void ChunkLighted(
int a_ChunkX, int a_ChunkZ,
@@ -111,9 +111,6 @@ public:
Returns true if the chunk was reported successfully, false if not (chunk not present or callback failed). */
bool GetChunkData(cChunkCoords a_Coords, cChunkDataCallback & a_Callback) const;
- /** Copies the chunk's blocktypes into a_Blocks; returns true if successful */
- bool GetChunkBlockTypes (int a_ChunkX, int a_ChunkZ, BLOCKTYPE * a_Blocks);
-
/** Returns true iff the chunk is in the loader / generator queue. */
bool IsChunkQueued(int a_ChunkX, int a_ChunkZ) const;
@@ -404,24 +401,6 @@ private:
// The chunkstay can (de-)register itself using AddChunkStay() and DelChunkStay()
friend class cChunkStay;
-
- class cStarvationCallbacks
- : public cAllocationPool<cChunkData::sChunkSection>::cStarvationCallbacks
- {
- virtual void OnStartUsingReserve() override
- {
- LOG("Using backup memory buffer");
- }
- virtual void OnEndUsingReserve() override
- {
- LOG("Stoped using backup memory buffer");
- }
- virtual void OnOutOfReserve() override
- {
- LOG("Out of Memory");
- }
- };
-
typedef std::list<cChunkStay *> cChunkStays;
mutable cCriticalSection m_CSChunks;
@@ -437,8 +416,6 @@ private:
/** The cChunkStay descendants that are currently enabled in this chunkmap */
cChunkStays m_ChunkStays;
- std::unique_ptr<cAllocationPool<cChunkData::sChunkSection> > m_Pool;
-
/** Returns or creates and returns a chunk pointer corresponding to the given chunk coordinates.
Emplaces this chunk in the chunk map. */
cChunk & ConstructChunk(int a_ChunkX, int a_ChunkZ);