summaryrefslogtreecommitdiffstats
path: root/source/Chunk.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-22 17:54:09 +0200
committermadmaxoft <github@xoft.cz>2013-10-22 17:54:09 +0200
commit76ed2f441a1fb44f17d8446c47ec9fce99b6ccfa (patch)
treeda4ac6b5f189d4f92872decc206f8bde78b6c336 /source/Chunk.h
parentIgnoring a few generated files. (diff)
downloadcuberite-76ed2f441a1fb44f17d8446c47ec9fce99b6ccfa.tar
cuberite-76ed2f441a1fb44f17d8446c47ec9fce99b6ccfa.tar.gz
cuberite-76ed2f441a1fb44f17d8446c47ec9fce99b6ccfa.tar.bz2
cuberite-76ed2f441a1fb44f17d8446c47ec9fce99b6ccfa.tar.lz
cuberite-76ed2f441a1fb44f17d8446c47ec9fce99b6ccfa.tar.xz
cuberite-76ed2f441a1fb44f17d8446c47ec9fce99b6ccfa.tar.zst
cuberite-76ed2f441a1fb44f17d8446c47ec9fce99b6ccfa.zip
Diffstat (limited to '')
-rw-r--r--source/Chunk.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/Chunk.h b/source/Chunk.h
index aca180d16..e709a4718 100644
--- a/source/Chunk.h
+++ b/source/Chunk.h
@@ -171,11 +171,12 @@ public:
cChunk * GetRelNeighborChunk(int a_RelX, int a_RelZ);
/**
- Returns the chunk into which the relatively-specified block belongs, by walking the neighbors.
+ Returns the chunk into which the relatively-specified block belongs.
Also modifies the relative coords from this-relative to return-relative.
- Will return self if appropriate. Returns NULL if not reachable through neighbors.
+ Will return self if appropriate.
+ Will try walking the neighbors first; if that fails, will query the chunkmap
*/
- cChunk * GetRelNeighborChunkAdjustCoords(int & a_RelX, int & a_RelZ);
+ cChunk * GetRelNeighborChunkAdjustCoords(int & a_RelX, int & a_RelZ) const;
EMCSBiome GetBiomeAt(int a_RelX, int a_RelZ) const {return cChunkDef::GetBiome(m_BiomeMap, a_RelX, a_RelZ); }
@@ -299,19 +300,25 @@ public:
inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return cChunkDef::GetNibble(m_BlockLight, a_RelX, a_RelY, a_RelZ); }
inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return cChunkDef::GetNibble(m_BlockSkyLight, a_RelX, a_RelY, a_RelZ); }
- /// 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()
+ /// 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
bool UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const;
- /// Same as GetBlockType(), 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()
+ /// Same as GetBlockType(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success
bool UnboundedRelGetBlockType(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType) const;
- /// Same as GetBlockMeta(), 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()
+ /// Same as GetBlockMeta(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success
bool UnboundedRelGetBlockMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_BlockMeta) const;
- /// 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()
+ /// Same as GetBlockBlockLight(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success
+ bool UnboundedRelGetBlockBlockLight(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_BlockLight) const;
+
+ /// Same as GetBlockSkyLight(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success
+ bool UnboundedRelGetBlockSkyLight(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_SkyLight) const;
+
+ /// 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
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_Neighbor-s or 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
bool UnboundedRelFastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
/// Same as QueueTickBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s in such a case), ignores unsuccessful attempts