summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-28 15:40:57 +0200
committerGitHub <noreply@github.com>2021-03-28 15:40:57 +0200
commit748b121703fa28b10933f4432c09391e66179118 (patch)
tree58a39b6a75c3e9127507bf3c185a99e546147276 /src/Simulator/IncrementalRedstoneSimulator/HopperHandler.h
parentFix Windows XP to 7 compatibility (#5167) (diff)
downloadcuberite-748b121703fa28b10933f4432c09391e66179118.tar
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.gz
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.bz2
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.lz
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.xz
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.zst
cuberite-748b121703fa28b10933f4432c09391e66179118.zip
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;
});
}