From c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 1 Aug 2020 11:25:06 +0100 Subject: Corrected wakeup sequences * Pistons/Ice no longer need to FastSetBlock first (#4600), and the former don't drop items when broken in creative - Begin migration away from stationary fluids * Tick the chunk after applying a client's changed * Broadcast pending blocks at the end of a tick --- src/Blocks/BlockVine.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/Blocks/BlockVine.h') diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h index 68e6e2ddc..25b6efe47 100644 --- a/src/Blocks/BlockVine.h +++ b/src/Blocks/BlockVine.h @@ -162,12 +162,12 @@ public: - virtual void Check( - cChunkInterface & a_ChunkInterface, cBlockPluginInterface & a_PluginInterface, - Vector3i a_RelPos, - cChunk & a_Chunk - ) override + virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor) override { + a_ChunkInterface.DoWithChunkAt(a_BlockPos, [&](cChunk & a_Chunk) + { + + const auto a_RelPos = a_Chunk.AbsoluteToRelative(a_BlockPos); NIBBLETYPE CurMeta = a_Chunk.GetMeta(a_RelPos); NIBBLETYPE MaxMeta = GetMaxMeta(a_Chunk, a_RelPos); @@ -190,14 +190,13 @@ public: a_ChunkInterface.DropBlockAsPickups(a_Chunk.RelativeToAbsolute(a_RelPos)); } a_Chunk.SetBlock(a_RelPos, E_BLOCK_AIR, 0); - return; + return false; } a_Chunk.SetBlock(a_RelPos, m_BlockType, Common); } - else - { - a_Chunk.GetWorld()->GetSimulatorManager()->WakeUp(a_Chunk, a_RelPos); - } + + return false; + }); } -- cgit v1.2.3