1
0

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
This commit is contained in:
Tiger Wang
2020-08-26 21:45:13 +01:00
parent ecd8f0c0de
commit b084f1f13f
11 changed files with 33 additions and 62 deletions

View File

@@ -1290,7 +1290,7 @@ void cChunk::SetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_Blo
void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta, bool a_SendToClients)
void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta)
{
ASSERT(!((a_RelX < 0) || (a_RelX >= Width) || (a_RelY < 0) || (a_RelY >= Height) || (a_RelZ < 0) || (a_RelZ >= Width)));
@@ -1319,15 +1319,12 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT
// Queue block to be sent only if ...
if (
a_SendToClients && // ... we are told to do so AND ...
!( // ... the old and new blocktypes AREN'T leaves (because the client doesn't need meta updates)
((OldBlockType == E_BLOCK_LEAVES) && (a_BlockType == E_BLOCK_LEAVES)) ||
((OldBlockType == E_BLOCK_NEW_LEAVES) && (a_BlockType == E_BLOCK_NEW_LEAVES))
) && // ... AND ...
(
!( // ... the old and new blocktypes AREN'T leaves (because the client doesn't need meta updates)
((OldBlockType == E_BLOCK_LEAVES) && (a_BlockType == E_BLOCK_LEAVES)) ||
((OldBlockType == E_BLOCK_NEW_LEAVES) && (a_BlockType == E_BLOCK_NEW_LEAVES))
) && // ... AND ...
(
(OldBlockMeta != a_BlockMeta) || (!ReplacingLiquids)
)
(OldBlockMeta != a_BlockMeta) || (!ReplacingLiquids)
)
)
{