diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-18 15:52:38 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-18 15:52:38 +0200 |
commit | 8a3174164b0ee3e902031d631c690ed555b74f05 (patch) | |
tree | 5d0a89011ed381f7223b93912504eeaaf5e16c4f /source/ChunkMap.cpp | |
parent | Enhancements to Tabcompletion and Compile Fix (diff) | |
download | cuberite-8a3174164b0ee3e902031d631c690ed555b74f05.tar cuberite-8a3174164b0ee3e902031d631c690ed555b74f05.tar.gz cuberite-8a3174164b0ee3e902031d631c690ed555b74f05.tar.bz2 cuberite-8a3174164b0ee3e902031d631c690ed555b74f05.tar.lz cuberite-8a3174164b0ee3e902031d631c690ed555b74f05.tar.xz cuberite-8a3174164b0ee3e902031d631c690ed555b74f05.tar.zst cuberite-8a3174164b0ee3e902031d631c690ed555b74f05.zip |
Diffstat (limited to 'source/ChunkMap.cpp')
-rw-r--r-- | source/ChunkMap.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp index 5a16495e6..4180ae327 100644 --- a/source/ChunkMap.cpp +++ b/source/ChunkMap.cpp @@ -1171,6 +1171,24 @@ void cChunkMap::SetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_B +void cChunkMap::SetServerBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta) +{ + int ChunkX, ChunkZ, X = a_BlockX, Y = a_BlockY, Z = a_BlockZ; + cChunkDef::AbsoluteToRelative( X, Y, Z, ChunkX, ChunkZ ); + + cCSLock Lock(m_CSLayers); + cChunkPtr Chunk = GetChunk( ChunkX, ZERO_CHUNK_Y, ChunkZ ); + if ((Chunk != NULL) && Chunk->IsValid()) + { + Chunk->SetServerBlock(X, Y, Z, a_BlockType, a_BlockMeta ); + m_World->GetSimulatorManager()->WakeUp(a_BlockX, a_BlockY, a_BlockZ, Chunk); + } +} + + + + + bool cChunkMap::GetBlockTypeMeta(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) { int ChunkX, ChunkZ, X = a_BlockX, Y = a_BlockY, Z = a_BlockZ; |