diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-07-29 01:12:45 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-02 16:52:06 +0200 |
commit | 99856df6869d32731e6fdcfeb1460297410f5820 (patch) | |
tree | c93afdb7dac377ff6c04732190a3efbe3a091c4b /src/Simulator/DelayedFluidSimulator.cpp | |
parent | Do not impose redstone wakup penalty for all blocks (diff) | |
download | cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.gz cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.bz2 cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.lz cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.xz cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.zst cuberite-99856df6869d32731e6fdcfeb1460297410f5820.zip |
Diffstat (limited to 'src/Simulator/DelayedFluidSimulator.cpp')
-rw-r--r-- | src/Simulator/DelayedFluidSimulator.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Simulator/DelayedFluidSimulator.cpp b/src/Simulator/DelayedFluidSimulator.cpp index d4537656d..af9007548 100644 --- a/src/Simulator/DelayedFluidSimulator.cpp +++ b/src/Simulator/DelayedFluidSimulator.cpp @@ -78,19 +78,8 @@ cDelayedFluidSimulator::cDelayedFluidSimulator(cWorld & a_World, BLOCKTYPE a_Flu -void cDelayedFluidSimulator::AddBlock(Vector3i a_Block, cChunk * a_Chunk) +void cDelayedFluidSimulator::AddBlock(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) { - if ((a_Block.y < 0) || (a_Block.y >= cChunkDef::Height)) - { - // Not inside the world (may happen when rclk with a full bucket - the client sends Y = -1) - return; - } - - if ((a_Chunk == nullptr) || !a_Chunk->IsValid()) - { - return; - } - int RelX = a_Block.x - a_Chunk->GetPosX() * cChunkDef::Width; int RelZ = a_Block.z - a_Chunk->GetPosZ() * cChunkDef::Width; BLOCKTYPE BlockType = a_Chunk->GetBlock(RelX, a_Block.y, RelZ); @@ -156,3 +145,14 @@ void cDelayedFluidSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a + +void cDelayedFluidSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) +{ + if (!cChunkDef::IsValidHeight(a_Position.y)) + { + // Not inside the world (may happen when rclk with a full bucket - the client sends Y = -1) + return; + } + + Super::WakeUp(a_Chunk, a_Position, a_Block); +} |