summaryrefslogtreecommitdiffstats
path: root/source/Chunk.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-12-14 23:38:30 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-12-14 23:38:30 +0100
commit310c1076a7acce6e4dd4c2611527b65fe86fe351 (patch)
treefb09cc624c13fa6336b7f78575737154a3358cee /source/Chunk.h
parentFixed cCriticalSection's debugging functions (diff)
downloadcuberite-310c1076a7acce6e4dd4c2611527b65fe86fe351.tar
cuberite-310c1076a7acce6e4dd4c2611527b65fe86fe351.tar.gz
cuberite-310c1076a7acce6e4dd4c2611527b65fe86fe351.tar.bz2
cuberite-310c1076a7acce6e4dd4c2611527b65fe86fe351.tar.lz
cuberite-310c1076a7acce6e4dd4c2611527b65fe86fe351.tar.xz
cuberite-310c1076a7acce6e4dd4c2611527b65fe86fe351.tar.zst
cuberite-310c1076a7acce6e4dd4c2611527b65fe86fe351.zip
Diffstat (limited to '')
-rw-r--r--source/Chunk.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/Chunk.h b/source/Chunk.h
index eaa4f82b8..c285a26e3 100644
--- a/source/Chunk.h
+++ b/source/Chunk.h
@@ -59,7 +59,11 @@ class cChunk :
public cChunkDef // The inheritance is "misused" here only to inherit the functions and constants defined in cChunkDef
{
public:
- cChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cChunkMap * a_ChunkMap, cWorld * a_World);
+ cChunk(
+ int a_ChunkX, int a_ChunkY, int a_ChunkZ, // Chunk coords
+ cChunkMap * a_ChunkMap, cWorld * a_World, // Parent objects
+ cChunk * a_NeighborXM, cChunk * a_NeighborXP, cChunk * a_NeighborZM, cChunk * a_NeighborZP // Neighbor chunks
+ );
~cChunk();
bool IsValid(void) const {return m_IsValid; } // Returns true if the chunk block data is valid (loaded / generated)
@@ -267,6 +271,11 @@ private:
cChunkDef::BiomeMap m_BiomeMap;
int m_BlockTickX, m_BlockTickY, m_BlockTickZ;
+
+ cChunk * m_NeighborXM; // Neighbor at [X - 1, Z]
+ cChunk * m_NeighborXP; // Neighbor at [X + 1, Z]
+ cChunk * m_NeighborZM; // Neighbor at [X, Z - 1]
+ cChunk * m_NeighborZP; // Neighbor at [X, Z + 1]
void RemoveBlockEntity( cBlockEntity* a_BlockEntity );
void AddBlockEntity( cBlockEntity* a_BlockEntity );
@@ -303,13 +312,13 @@ private:
/// Checks if a leaves block at the specified coords has a log up to 4 blocks away connected by other leaves blocks (false if no log)
bool HasNearLog(cBlockArea & a_Area, int a_BlockX, int a_BlockY, int a_BlockZ);
- /// Same as GetBlock(), but relative coords needn't be in this chunk (uses m_ChunkMap in such a case); returns true on success; only usable in Tick()
+ /// Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success; only usable in Tick()
bool UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta);
- /// Same as SetBlock(), but relative coords needn't be in this chunk (uses m_ChunkMap in such a case); returns true on success; only usable in Tick()
+ /// Same as SetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success; only usable in Tick()
bool UnboundedRelSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- /// Same as FastSetBlock(), but relative coords needn't be in this chunk (uses m_ChunkMap in such a case); returns true on success; only usable in Tick()
+ /// Same as FastSetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success; only usable in Tick()
bool UnboundedRelFastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
};