1
0
cuberite-2a/src/Simulator/VaporizeFluidSimulator.cpp

60 lines
1.0 KiB
C++
Raw Normal View History

// VaporizeFluidSimulator.cpp
// Implements the cVaporizeFluidSimulator class representing a fluid simulator that replaces all fluid blocks with air
#include "Globals.h"
#include "VaporizeFluidSimulator.h"
#include "../OpaqueWorld.h"
#include "../Chunk.h"
#include "../Blocks/BroadcastInterface.h"
cVaporizeFluidSimulator::cVaporizeFluidSimulator(cWorld & a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid) :
super(a_World, a_Fluid, a_StationaryFluid)
{
}
void cVaporizeFluidSimulator::AddBlock(Vector3i a_Block, cChunk * a_Chunk)
{
2014-10-20 16:55:07 -04:00
if (a_Chunk == nullptr)
{
return;
}
auto relPos = cChunkDef::AbsoluteToRelative(a_Block);
auto blockType = a_Chunk->GetBlock(relPos);
if (
(blockType == m_FluidBlock) ||
(blockType == m_StationaryFluidBlock)
)
{
a_Chunk->SetBlock(relPos, E_BLOCK_AIR, 0);
World::GetBroadcastInterface(m_World).BroadcastSoundEffect(
2017-02-15 00:05:24 -05:00
"block.fire.extinguish",
Vector3d(a_Block),
2015-05-28 07:29:26 -04:00
1.0f,
0.6f
);
}
}
void cVaporizeFluidSimulator::Simulate(float a_Dt)
{
// Nothing needed
}