summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-19 22:14:40 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-21 01:50:09 +0200
commit3143d6ce679f322ee73d3d70e2d843e9c98cc043 (patch)
tree8ccc3b6d2a22a848e0c01c667aa10b25c3a5684e /src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
parentMinor typo fixes (diff)
downloadcuberite-3143d6ce679f322ee73d3d70e2d843e9c98cc043.tar
cuberite-3143d6ce679f322ee73d3d70e2d843e9c98cc043.tar.gz
cuberite-3143d6ce679f322ee73d3d70e2d843e9c98cc043.tar.bz2
cuberite-3143d6ce679f322ee73d3d70e2d843e9c98cc043.tar.lz
cuberite-3143d6ce679f322ee73d3d70e2d843e9c98cc043.tar.xz
cuberite-3143d6ce679f322ee73d3d70e2d843e9c98cc043.tar.zst
cuberite-3143d6ce679f322ee73d3d70e2d843e9c98cc043.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp b/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
index 3bf0fc371..a0dd8fe94 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
@@ -2,9 +2,10 @@
#include "Globals.h"
#include "ForEachSourceCallback.h"
-#include "IncrementalRedstoneSimulator.h"
#include "../../BlockInfo.h"
#include "../../Chunk.h"
+#include "IncrementalRedstoneSimulator.h"
+#include "RedstoneHandler.h"
@@ -67,16 +68,10 @@ void ForEachSourceCallback::operator()(Vector3i Location)
PoweringData ForEachSourceCallback::QueryPower(const cChunk & Chunk, const Vector3i SourcePosition, const BLOCKTYPE SourceBlock, const Vector3i QueryPosition, const BLOCKTYPE QueryBlock, const bool IsLinked)
{
- const auto PotentialSourceHandler = cIncrementalRedstoneSimulator::GetComponentHandler(SourceBlock);
- if (PotentialSourceHandler == nullptr)
- {
- return {};
- }
-
return
{
SourceBlock,
- PotentialSourceHandler->GetPowerDeliveredToPosition(
+ RedstoneHandler::GetPowerDeliveredToPosition(
Chunk, SourcePosition, SourceBlock,
QueryPosition, QueryBlock, IsLinked
)