25 default:
return false;
90 default:
return false;
118 for (
auto & DelayInfo : ChunkData.m_MechanismDelays)
120 if ((--DelayInfo.second.first) == 0)
122 ChunkData.
WakeUp(DelayInfo.first);
127 auto & WorkQueue = ChunkData.GetActiveBlocks();
130 while (!WorkQueue.empty())
133 Vector3i CurrentLocation = WorkQueue.top();
137 if ((NeighbourChunk ==
nullptr) || !NeighbourChunk->IsValid())
145 for (
const auto & Position : ChunkData.AlwaysTickedPositions)
147 ChunkData.WakeUp(Position);
177 ChunkData.WakeUp(a_Position);
200 AddBlock(a_Chunk, a_Position, a_Block);
212 AddBlock(a_Chunk, a_Position, a_Block);
219 auto Relative = a_Position - a_Offset + Offset;
228 if ((Chunk ==
nullptr) || !Chunk->IsValid())
233 const auto Block = Chunk->GetBlock(Relative);
@ E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE
@ E_BLOCK_REDSTONE_LAMP_OFF
@ E_BLOCK_REDSTONE_TORCH_ON
@ E_BLOCK_STONE_PRESSURE_PLATE
@ E_BLOCK_DAYLIGHT_SENSOR
@ E_BLOCK_REDSTONE_REPEATER_ON
@ E_BLOCK_BIRCH_FENCE_GATE
@ E_BLOCK_ACACIA_FENCE_GATE
@ E_BLOCK_BLOCK_OF_REDSTONE
@ E_BLOCK_INACTIVE_COMPARATOR
@ E_BLOCK_ACTIVE_COMPARATOR
@ E_BLOCK_SPRUCE_FENCE_GATE
@ E_BLOCK_DARK_OAK_FENCE_GATE
@ E_BLOCK_JUNGLE_FENCE_GATE
@ E_BLOCK_WOODEN_PRESSURE_PLATE
@ E_BLOCK_REDSTONE_TORCH_OFF
@ E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE
@ E_BLOCK_REDSTONE_REPEATER_OFF
@ E_BLOCK_REDSTONE_LAMP_ON
@ E_BLOCK_INVERTED_DAYLIGHT_SENSOR
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
void SetWireState(const cChunk &Chunk, const Vector3i Position)
Temporary: compute and set the block state of a redstone wire.
void Update(cChunk &Chunk, cChunk &CurrentlyTicking, const Vector3i Position, const BLOCKTYPE BlockType, const NIBBLETYPE Meta, const PowerLevel PowerLevel)
Tells a redstone component at this position to update itself.
void ForValidSourcePositions(const cChunk &Chunk, const Vector3i Position, const BLOCKTYPE BlockType, const NIBBLETYPE Meta, ForEachSourceCallback &Callback)
Invokes Callback for each position this component can accept power from.
cChunk * GetRelNeighborChunkAdjustCoords(Vector3i &a_RelPos) const
Returns the chunk into which the relatively-specified block belongs.
cRedstoneSimulatorChunkData * GetRedstoneSimulatorData(void) const
void GetBlockTypeMeta(Vector3i a_RelPos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
static bool IsValidHeight(Vector3i a_BlockPosition)
Validates a height-coordinate.
static bool IsRedstone(BLOCKTYPE a_Block)
Returns if a block is any sort of redstone device.
virtual void WakeUp(cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override
Called to simulate a single new block, typically as a result of a single block break or change.
void ProcessWorkItem(cChunk &Chunk, cChunk &TickingSource, const Vector3i Position)
virtual void AddBlock(cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override
Called to simulate a new block.
virtual void SimulateChunk(std::chrono::milliseconds Dt, int ChunkX, int ChunkZ, cChunk *Chunk) override
static bool IsAlwaysTicked(BLOCKTYPE a_Block)
Returns if a redstone device is always ticked due to influence by its environment.
virtual cRedstoneSimulatorChunkData * CreateChunkData() override
std::unordered_set< Vector3i, VectorHasher< int > > AlwaysTickedPositions
void WakeUp(const Vector3i &a_Position)
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...