summaryrefslogtreecommitdiffstats
path: root/src/Simulator
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-08-05 23:54:36 +0200
committerTycho <work.tycho+git@gmail.com>2014-08-05 23:54:36 +0200
commit9272bd627c732771b81e6dcf6b8465404917a9d6 (patch)
tree617cb2f8d97901df9e9a47df813c63c6d724563e /src/Simulator
parentRefactored Redstone simulator not to depend on TNTEntity or DropSpenserENtity Directly (diff)
downloadcuberite-9272bd627c732771b81e6dcf6b8465404917a9d6.tar
cuberite-9272bd627c732771b81e6dcf6b8465404917a9d6.tar.gz
cuberite-9272bd627c732771b81e6dcf6b8465404917a9d6.tar.bz2
cuberite-9272bd627c732771b81e6dcf6b8465404917a9d6.tar.lz
cuberite-9272bd627c732771b81e6dcf6b8465404917a9d6.tar.xz
cuberite-9272bd627c732771b81e6dcf6b8465404917a9d6.tar.zst
cuberite-9272bd627c732771b81e6dcf6b8465404917a9d6.zip
Diffstat (limited to 'src/Simulator')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp
index 5b2439db1..7b3a2c2fa 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -4,7 +4,6 @@
#include "IncrementalRedstoneSimulator.h"
#include "BoundingBox.h"
#include "../BlockEntities/RedstonePoweredEntity.h"
-#include "../BlockEntities/NoteEntity.h"
#include "../BlockEntities/ChestEntity.h"
#include "../BlockEntities/CommandBlockEntity.h"
#include "../Entities/Pickup.h"
@@ -1033,25 +1032,21 @@ void cIncrementalRedstoneSimulator::HandleNoteBlock(int a_RelBlockX, int a_RelBl
if (!AreCoordsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, true))
{
class cSetPowerToNoteBlock :
- public cNoteBlockCallback
+ public cRedstonePoweredCallback
{
- bool m_IsPowered;
public:
- cSetPowerToNoteBlock(bool a_IsPowered) : m_IsPowered(a_IsPowered) {}
+ cSetPowerToNoteBlock() {}
- virtual bool Item(cNoteEntity * a_NoteBlock) override
+ virtual bool Item(cRedstonePoweredEntity * a_NoteBlock) override
{
- if (m_IsPowered)
- {
- a_NoteBlock->MakeSound();
- }
+ a_NoteBlock->SetRedstonePower(true);
return false;
}
- } NoteBlockSP(m_bAreCoordsPowered);
+ } NoteBlockSP;
int BlockX = (m_Chunk->GetPosX() * cChunkDef::Width) + a_RelBlockX;
int BlockZ = (m_Chunk->GetPosZ() * cChunkDef::Width) + a_RelBlockZ;
- m_Chunk->DoWithNoteBlockAt(BlockX, a_RelBlockY, BlockZ, NoteBlockSP);
+ m_Chunk->DoWithRedstonePoweredEntityAt(BlockX, a_RelBlockY, BlockZ, NoteBlockSP);
SetPlayerToggleableBlockAsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, true);
}
}