6 #include "../../BlockInfo.h"
7 #include "../../Chunk.h"
19 m_CurrentBlock(CurrentBlock)
35 if ((NeighbourChunk ==
nullptr) || !NeighbourChunk->IsValid())
40 const auto PotentialSourceBlock = NeighbourChunk->
GetBlock(Location);
52 *NeighbourChunk, Location, PotentialSourceBlock,
80 QuasiQueryCallback(
m_Position + QuasiPowerOffset);
98 auto SourcePosition = QueryPosition + Offset;
105 if ((NeighbourChunk ==
nullptr) || !NeighbourChunk->IsValid())
117 *NeighbourChunk, SourcePosition, NeighbourChunk->GetBlock(SourcePosition),
118 NeighbourRelativeSolidBlockPosition, QueryBlock,
true
unsigned char BLOCKTYPE
The datatype used by blockdata.
constexpr Vector3i OffsetYP
unsigned char Power(const BlockState Block)
PowerLevel GetPowerDeliveredToPosition(const cChunk &Chunk, const Vector3i Position, const BLOCKTYPE BlockType, const Vector3i QueryPosition, const BLOCKTYPE QueryBlockType, const bool IsLinked)
Asks a redstone component at the source position how much power it will deliver to the querying posit...
static bool IsTransparent(BLOCKTYPE Block)
Is a block transparent? (https://minecraft.wiki/w/Opacity)
BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
cChunk * GetRelNeighborChunkAdjustCoords(Vector3i &a_RelPos) const
Returns the chunk into which the relatively-specified block belongs.
static bool IsValidHeight(Vector3i a_BlockPosition)
Validates a height-coordinate.
const Vector3i m_Position
ForEachSourceCallback(const cChunk &Chunk, Vector3i Position, BLOCKTYPE CurrentBlock)
const BLOCKTYPE m_CurrentBlock
void operator()(Vector3i Location)
Callback invoked for each potential source position of the redstone component.
static PowerLevel QueryLinkedPower(const cChunk &Chunk, Vector3i QueryPosition, BLOCKTYPE QueryBlock, Vector3i SolidBlockPosition)
Asks redstone handlers adjacent to a solid block how much power they will deliver to the querying pos...
void CheckIndirectPower()
Callback invoked for blocks supporting quasiconnectivity.
static Vector3i RebaseRelativePosition(const cChunk &From, const cChunk &To, const Vector3i Position)
Adjust From-relative coordinates into To-relative coordinates.
static std::array< Vector3i, 5 > GetLinkedOffsets(Vector3i Offset)
For a given offset from a position, return the offsets that represent the adjacents of the newly offs...