9 #include "../BlockArea.h" 10 #include "../Blocks/BlockHandler.h" 11 #include "../BlockInServerPluginInterface.h" 29 int a_NumNeighborsForSource
30 ) :
super(a_World, a_Fluid, a_StationaryFluid, a_Falloff, a_TickDelay, a_NumNeighborsForSource)
49 for (
unsigned int i = 0; i <
ARRAYCOUNT(Cost); ++i)
51 if (Cost[i] < MinCost)
58 if (Cost[0] == MinCost)
62 if (Cost[1] == MinCost)
66 if (Cost[2] == MinCost)
70 if (Cost[3] == MinCost)
101 if ((a_RelY > 0) && !a_Chunk->
UnboundedRelGetBlock(a_RelX, a_RelY - 1, a_RelZ, BlockType, BlockMeta))
108 return static_cast<int>(a_Iteration);
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override
Returns true if the specified block type is "interesting" for this simulator.
unsigned char BLOCKTYPE
The datatype used by blockdata.
bool IsPassableForFluid(BLOCKTYPE a_BlockType)
virtual void SpreadXZ(cChunk *a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_NewMeta) override
Spread fluid to XZ neighbors.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
cVanillaFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, NIBBLETYPE a_Falloff, int a_TickDelay, int a_NumNeighborsForSource)
bool IsBlockLiquid(BLOCKTYPE a_BlockType)
bool UnboundedRelGetBlock(Vector3i a_RelCoords, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in ...
void SpreadToNeighbor(cChunk *a_NearChunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_NewMeta)
Spreads into the specified block, if the blocktype there allows.
static const int InfiniteCost
int CalculateFlowCost(cChunk *a_Chunk, int a_RelX, int a_RelY, int a_RelZ, Direction a_Dir, unsigned a_Iteration=0)
Recursively calculates the minimum number of blocks needed to descend a level.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)