From 748b121703fa28b10933f4432c09391e66179118 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 28 Mar 2021 14:40:57 +0100 Subject: Unify DoWithBlockEntity (#5168) + DoWith calls now broadcast the block entity and mark the chunk dirty + Add block entity change queue to synchronise BE updates with block updates * Fixed a few incorrect assertions about BE type - Remove manual overloads --- src/Blocks/BlockNoteBlock.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/Blocks/BlockNoteBlock.h') diff --git a/src/Blocks/BlockNoteBlock.h b/src/Blocks/BlockNoteBlock.h index ac1ab7238..566b9bef5 100644 --- a/src/Blocks/BlockNoteBlock.h +++ b/src/Blocks/BlockNoteBlock.h @@ -26,18 +26,15 @@ private: const Vector3i a_BlockPos ) const override { - a_WorldInterface.DoWithBlockEntityAt(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, [](cBlockEntity & a_BlockEntity) + a_WorldInterface.DoWithBlockEntityAt(a_BlockPos, [](cBlockEntity & a_BlockEntity) { if (a_BlockEntity.GetBlockType() != E_BLOCK_NOTE_BLOCK) { return false; } - auto & NoteEntity = static_cast(a_BlockEntity); - - NoteEntity.MakeSound(); - - return true; + static_cast(a_BlockEntity).MakeSound(); + return false; }); } }; -- cgit v1.2.3