summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
diff options
context:
space:
mode:
authorMichal Havlíček <80639037+havel06@users.noreply.github.com>2021-12-30 23:09:58 +0100
committerGitHub <noreply@github.com>2021-12-30 23:09:58 +0100
commit158435737eff36ad3217991a13ee8da431a580a0 (patch)
tree03990184a1800c090d698650913375547edbb7bb /src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
parentAdd skeleton bow pulling animation (#5355) (diff)
downloadcuberite-158435737eff36ad3217991a13ee8da431a580a0.tar
cuberite-158435737eff36ad3217991a13ee8da431a580a0.tar.gz
cuberite-158435737eff36ad3217991a13ee8da431a580a0.tar.bz2
cuberite-158435737eff36ad3217991a13ee8da431a580a0.tar.lz
cuberite-158435737eff36ad3217991a13ee8da431a580a0.tar.xz
cuberite-158435737eff36ad3217991a13ee8da431a580a0.tar.zst
cuberite-158435737eff36ad3217991a13ee8da431a580a0.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp b/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
index 9505b12da..e8a8515eb 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp
@@ -40,7 +40,7 @@ void ForEachSourceCallback::operator()(Vector3i Location)
const auto PotentialSourceBlock = NeighbourChunk->GetBlock(Location);
const auto NeighbourRelativeQueryPosition = cIncrementalRedstoneSimulatorChunkData::RebaseRelativePosition(m_Chunk, *NeighbourChunk, m_Position);
- if (ShouldQueryLinkedPosition(PotentialSourceBlock))
+ if (!cBlockInfo::IsTransparent(PotentialSourceBlock))
{
Power = std::max(Power, QueryLinkedPower(*NeighbourChunk, NeighbourRelativeQueryPosition, m_CurrentBlock, Location));
}
@@ -88,32 +88,6 @@ void ForEachSourceCallback::CheckIndirectPower()
-bool ForEachSourceCallback::ShouldQueryLinkedPosition(const BLOCKTYPE Block)
-{
- switch (Block)
- {
- // Normally we don't ask solid blocks for power because they don't have any (stone, dirt, etc.)
- // However, these are mechanisms that are IsSolid, but still give power. Don't ignore them:
- case E_BLOCK_BLOCK_OF_REDSTONE:
- case E_BLOCK_DAYLIGHT_SENSOR:
- case E_BLOCK_INVERTED_DAYLIGHT_SENSOR:
- case E_BLOCK_OBSERVER:
- case E_BLOCK_TRAPPED_CHEST: return false;
-
- // Pistons are solid but don't participate in link powering:
- case E_BLOCK_PISTON:
- case E_BLOCK_PISTON_EXTENSION:
- case E_BLOCK_STICKY_PISTON: return false;
-
- // If a mechanism asks for power from a block, redirect the query to linked positions if:
- default: return cBlockInfo::IsSolid(Block);
- }
-}
-
-
-
-
-
PowerLevel ForEachSourceCallback::QueryLinkedPower(const cChunk & Chunk, const Vector3i QueryPosition, const BLOCKTYPE QueryBlock, const Vector3i SolidBlockPosition)
{
PowerLevel Power = 0;