diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-01 12:25:06 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-04 19:15:18 +0200 |
commit | c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a (patch) | |
tree | 26ac0ff00942aef4deafdc2048f8c14a168f4f93 /src/Blocks/BlockVine.h | |
parent | OnBroken/OnPlaced are for entity actions (diff) | |
download | cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.gz cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.bz2 cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.lz cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.xz cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.zst cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.zip |
Diffstat (limited to 'src/Blocks/BlockVine.h')
-rw-r--r-- | src/Blocks/BlockVine.h | 19 |
1 files changed, 9 insertions, 10 deletions
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; + }); } |