Add WakeUp/AddBlock distinction

* WakeUp is for singular changes (block breaking for example). The simulator should check blocks around the position and discover other affected blocks as it sees fit
* AddBlock is for when you know a whole area is to be updated; chunk loading, or area wakeups for example
+ Prepares for correct handling of destroyed blocks after removal of SolidBlockHandler in the redstone simulator
This commit is contained in:
Tiger Wang
2020-08-02 15:52:06 +01:00
parent 6d7b83a69d
commit 99856df686
20 changed files with 144 additions and 124 deletions
@@ -21,6 +21,10 @@ public:
{
}
private:
virtual void WakeUp(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override;
virtual void Simulate(float Dt) override {};
virtual void SimulateChunk(std::chrono::milliseconds Dt, int ChunkX, int ChunkZ, cChunk * Chunk) override;
@@ -36,7 +40,7 @@ public:
return IsRedstone(a_BlockType);
}
virtual void AddBlock(Vector3i a_Block, cChunk * a_Chunk) override;
virtual void AddBlock(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override;
/** Returns if a block is a mechanism (something that accepts power and does something)
Used by torches to determine if they will power a block */