diff options
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/NoteBlockHandler.h')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator/NoteBlockHandler.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/NoteBlockHandler.h b/src/Simulator/IncrementalRedstoneSimulator/NoteBlockHandler.h index 6a2f66737..8bd639357 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/NoteBlockHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/NoteBlockHandler.h @@ -31,9 +31,14 @@ namespace NoteBlockHandler return; } - a_Chunk.DoWithNoteBlockAt(a_Position, [](cNoteEntity & a_NoteBlock) + a_Chunk.DoWithBlockEntityAt(a_Position, [](cBlockEntity & a_BlockEntity) { - a_NoteBlock.MakeSound(); + if (a_BlockEntity.GetBlockType() != E_BLOCK_NOTE_BLOCK) + { + return false; + } + + static_cast<cNoteEntity &>(a_BlockEntity).MakeSound(); return false; }); } |