summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h b/src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h
index 998a98677..379f7c7d8 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h
@@ -30,9 +30,14 @@ namespace HopperHandler
return;
}
- a_Chunk.DoWithHopperAt(a_Position, [Power](cHopperEntity & a_Hopper)
+ a_Chunk.DoWithBlockEntityAt(a_Position, [Power](cBlockEntity & a_BlockEntity)
{
- a_Hopper.SetLocked(Power != 0);
+ if (a_BlockEntity.GetBlockType() != E_BLOCK_HOPPER)
+ {
+ return false;
+ }
+
+ static_cast<cHopperEntity &>(a_BlockEntity).SetLocked(Power != 0);
return false;
});
}