summaryrefslogtreecommitdiffstats
path: root/source/cChunkMap.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-21 13:29:05 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-21 13:29:05 +0100
commitb4a68e58a9badb0f33d43a4cce9877935b2cc917 (patch)
treeb9436d62cdd326166d6d0d3e6e35e04673d311f7 /source/cChunkMap.cpp
parentRevised GNUmakefile for header file dependencies (again; this time it should work ;) (diff)
downloadcuberite-b4a68e58a9badb0f33d43a4cce9877935b2cc917.tar
cuberite-b4a68e58a9badb0f33d43a4cce9877935b2cc917.tar.gz
cuberite-b4a68e58a9badb0f33d43a4cce9877935b2cc917.tar.bz2
cuberite-b4a68e58a9badb0f33d43a4cce9877935b2cc917.tar.lz
cuberite-b4a68e58a9badb0f33d43a4cce9877935b2cc917.tar.xz
cuberite-b4a68e58a9badb0f33d43a4cce9877935b2cc917.tar.zst
cuberite-b4a68e58a9badb0f33d43a4cce9877935b2cc917.zip
Diffstat (limited to 'source/cChunkMap.cpp')
-rw-r--r--source/cChunkMap.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp
index 6ae3fd987..3e59c08ef 100644
--- a/source/cChunkMap.cpp
+++ b/source/cChunkMap.cpp
@@ -442,6 +442,43 @@ void cChunkMap::CollectPickupsByPlayer(cPlayer * a_Player)
+char cChunkMap::GetBlock(int a_X, int a_Y, int a_Z)
+{
+ int ChunkX, ChunkZ;
+ AbsoluteToRelative( a_X, a_Y, a_Z, ChunkX, ChunkZ );
+
+ cCSLock Lock(m_CSLayers);
+ cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
+ if ((Chunk != NULL) && Chunk->IsValid())
+ {
+ return Chunk->GetBlock(a_X, a_Y, a_Z);
+ }
+ return 0;
+}
+
+
+
+
+
+char cChunkMap::GetBlockMeta(int a_X, int a_Y, int a_Z)
+{
+ int ChunkX, ChunkZ;
+ AbsoluteToRelative( a_X, a_Y, a_Z, ChunkX, ChunkZ );
+
+ cCSLock Lock(m_CSLayers);
+ cChunkPtr Chunk = GetChunk( ChunkX, ZERO_CHUNK_Y, ChunkZ );
+ if ((Chunk != NULL) && Chunk->IsValid() )
+ {
+ // Although it is called GetLight(), it actually gets meta when passed the Meta field
+ return Chunk->GetLight( Chunk->pGetMeta(), a_X, a_Y, a_Z );
+ }
+ return 0;
+}
+
+
+
+
+
void cChunkMap::CompareChunkClients(int a_ChunkX1, int a_ChunkY1, int a_ChunkZ1, int a_ChunkX2, int a_ChunkY2, int a_ChunkZ2, cClientDiffCallback & a_Callback)
{
cCSLock Lock(m_CSLayers);