diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-04 21:25:54 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-04 21:25:54 +0200 |
commit | 213a96e6d6373dc2a015a165d5309c20d460665d (patch) | |
tree | fad1c56ad379ced744955ae50e69715c49c40231 /src/Chunk.cpp | |
parent | Fixed ProtoProxy compilation in MSVC2013. (diff) | |
parent | Fixed 027efe09ea3d3222c3cbf169643e57773c1614ae (diff) | |
download | cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.gz cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.bz2 cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.lz cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.xz cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.zst cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 59e8894fc..ca536e89a 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -749,7 +749,7 @@ void cChunk::ProcessQueuedSetBlocks(void) { if (itr->m_Tick <= CurrTick) { - if (itr->m_PreviousType != E_BLOCK_AIR) // PreviousType defaults to -1 if not specified + if (itr->m_PreviousType != E_BLOCK_AIR) // PreviousType defaults to 0 if not specified { if (GetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ) == itr->m_PreviousType) { @@ -1638,6 +1638,24 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT +void cChunk::SetMeta(int a_BlockIdx, NIBBLETYPE a_Meta) +{ + if (GetNibble(m_BlockMeta, a_BlockIdx) == a_Meta) + { + return; + } + + MarkDirty(); + SetNibble(m_BlockMeta, a_BlockIdx, a_Meta); + Vector3i Coords(IndexToCoordinate(a_BlockIdx)); + + m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, Coords.x, Coords.y, Coords.z, GetBlock(a_BlockIdx), a_Meta)); +} + + + + + void cChunk::SendBlockTo(int a_RelX, int a_RelY, int a_RelZ, cClientHandle * a_Client) { // The coords must be valid, because the upper level already does chunk lookup. No need to check them again. |