summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 6b0058303..0303e1502 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -689,7 +689,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)
{
@@ -1568,6 +1568,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)
{