7 #include "../BlockInfo.h"
10 #include "../BlockArea.h"
11 #include "../Blocks/BlockHandler.h"
12 #include "../BlockInServerPluginInterface.h"
30 int a_NumNeighborsForSource
32 Super(a_World, a_Fluid, a_StationaryFluid, a_Falloff, a_TickDelay, a_NumNeighborsForSource)
51 for (
unsigned int i = 0; i <
ARRAYCOUNT(Cost); ++i)
53 if (Cost[i] < MinCost)
60 if (Cost[0] == MinCost)
64 if (Cost[1] == MinCost)
68 if (Cost[2] == MinCost)
72 if (Cost[3] == MinCost)
110 return static_cast<int>(a_Iteration);
bool IsBlockLiquid(BLOCKTYPE a_BlockType)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
static const int InfiniteCost
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.
bool IsAllowedBlock(BLOCKTYPE a_BlockType)
bool IsPassableForFluid(BLOCKTYPE a_BlockType)
cVanillaFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, NIBBLETYPE a_Falloff, int a_TickDelay, int a_NumNeighborsForSource)
virtual void SpreadXZ(cChunk *a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_NewMeta) override
Spread fluid to XZ neighbors.
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.