summaryrefslogtreecommitdiffstats
path: root/src/World.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/World.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 'src/World.h')
-rw-r--r--src/World.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/World.h b/src/World.h
index 9d68ff47d..ec114cedc 100644
--- a/src/World.h
+++ b/src/World.h
@@ -49,14 +49,12 @@ class cHopperEntity;
class cNoteEntity;
class cMobHeadEntity;
class cCompositeChat;
-class cSetChunkData;
class cDeadlockDetect;
class cUUID;
-typedef std::list< cPlayer * > cPlayerList;
+struct SetChunkData;
-typedef std::unique_ptr<cSetChunkData> cSetChunkDataPtr;
-typedef std::vector<cSetChunkDataPtr> cSetChunkDataPtrs;
+typedef std::list< cPlayer * > cPlayerList;
@@ -240,8 +238,8 @@ public:
void MarkChunkSaved (int a_ChunkX, int a_ChunkZ);
/** Puts the chunk data into a queue to be set into the chunkmap in the tick thread.
- If the chunk data doesn't contain valid biomes, the biomes are calculated before adding the data into the queue. */
- void QueueSetChunkData(cSetChunkDataPtr a_SetChunkData);
+ Modifies the a_SetChunkData - moves the entities contained in it into the queue. */
+ void QueueSetChunkData(SetChunkData && a_SetChunkData);
void ChunkLighted(
int a_ChunkX, int a_ChunkZ,
@@ -253,9 +251,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;
- /** Gets the chunk's blocks, only the block types */
- bool GetChunkBlockTypes(int a_ChunkX, int a_ChunkZ, BLOCKTYPE * a_BlockTypes);
-
/** Returns true iff the chunk is in the loader / generator queue. */
bool IsChunkQueued(int a_ChunkX, int a_ChunkZ) const;
@@ -1263,7 +1258,7 @@ private:
cCriticalSection m_CSSetChunkDataQueue;
/** Queue for the chunk data to be set into m_ChunkMap by the tick thread. Protected by m_CSSetChunkDataQueue */
- cSetChunkDataPtrs m_SetChunkDataQueue;
+ std::vector<SetChunkData> m_SetChunkDataQueue;
void Tick(std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_LastTickDurationMSec);
@@ -1273,6 +1268,9 @@ private:
/** Handles the mob spawning / moving / destroying each tick */
void TickMobs(std::chrono::milliseconds a_Dt);
+ /** Sets the chunk data queued in the m_SetChunkDataQueue queue into their chunk. */
+ void TickQueuedChunkDataSets();
+
/** Adds the entities queued in the m_EntitiesToAdd queue into their chunk.
If the entity was a player, he is also added to the m_Players list. */
void TickQueuedEntityAdditions(void);
@@ -1307,10 +1305,6 @@ private:
/** Sets mob spawning values if nonexistant to their dimension specific defaults */
void InitializeAndLoadMobSpawningValues(cIniFile & a_IniFile);
- /** Sets the specified chunk data into the chunkmap. Called in the tick thread.
- Modifies the a_SetChunkData - moves the entities contained in it into the chunk. */
- void SetChunkData(cSetChunkData & a_SetChunkData);
-
/** Checks if the sapling at the specified block coord is a part of a large-tree sapling (2x2).
If so, adjusts the coords so that they point to the northwest (XM ZM) corner of the sapling area and returns true.
Returns false if not a part of large-tree sapling. */