From b084f1f13fdd73e10fe296ef7d48a3c8beb95585 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 26 Aug 2020 21:45:13 +0100 Subject: Remove unneeded MarkDirty, SendToClients parameters of SetMeta Partially reverts #3129, whose addition of these parameters was superseded by #3149 that fixed generated leaves' metas. References: https://github.com/cuberite/cuberite/pull/4417#discussion_r334950513 e0bcd754009f16480437b2c1fa5e7fbedab31496 --- src/Chunk.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/Chunk.h') diff --git a/src/Chunk.h b/src/Chunk.h index a9b5bb99a..cb258c7f8 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -157,10 +157,10 @@ public: void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); // SetBlock() does a lot of work (heightmap, tickblocks, blockentities) so a BlockIdx version doesn't make sense - void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta, bool a_SendToClients = true); // Doesn't force block updates on neighbors, use for simple changes such as grass growing etc. - void FastSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta, bool a_SendToClients = true) + void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta); // Doesn't force block updates on neighbors, use for simple changes such as grass growing etc. + void FastSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta) { - FastSetBlock(a_RelPos.x, a_RelPos.y, a_RelPos.z, a_BlockType, a_BlockMeta, a_SendToClients); + FastSetBlock(a_RelPos.x, a_RelPos.y, a_RelPos.z, a_BlockType, a_BlockMeta); } BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const { return m_ChunkData.GetBlock({ a_RelX, a_RelY, a_RelZ }); } @@ -376,27 +376,21 @@ public: NIBBLETYPE GetMeta(Vector3i a_RelPos) const { return m_ChunkData.GetMeta(a_RelPos); } - void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta, bool a_ShouldMarkDirty = true, bool a_ShouldInformClients = true) + void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta) { - SetMeta({ a_RelX, a_RelY, a_RelZ }, a_Meta, a_ShouldMarkDirty, a_ShouldInformClients); + SetMeta({ a_RelX, a_RelY, a_RelZ }, a_Meta); } /** Set a meta value, with the option of not informing the client and / or not marking dirty. Used for setting metas that are of little value for saving to disk and / or for sending to the client, such as leaf decay flags. */ - inline void SetMeta(Vector3i a_RelPos, NIBBLETYPE a_Meta, bool a_ShouldMarkDirty = true, bool a_ShouldInformClients = true) + inline void SetMeta(Vector3i a_RelPos, NIBBLETYPE a_Meta) { bool hasChanged = m_ChunkData.SetMeta(a_RelPos, a_Meta); if (hasChanged) { - if (a_ShouldMarkDirty) - { - MarkDirty(); - } - if (a_ShouldInformClients) - { - m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelPos.x, a_RelPos.y, a_RelPos.z, GetBlock(a_RelPos), a_Meta)); - } + MarkDirty(); + m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelPos.x, a_RelPos.y, a_RelPos.z, GetBlock(a_RelPos), a_Meta)); } } -- cgit v1.2.3