Cuberite
A lightweight, fast and extensible game server for Minecraft
FloodyFluidSimulator.h
Go to the documentation of this file.
1 
2 // FloodyFluidSimulator.h
3 
4 // Interfaces to the cFloodyFluidSimulator that represents a fluid simulator that tries to flood everything :)
5 // https://forum.cuberite.org/thread-565.html
6 
7 
8 
9 
10 
11 #pragma once
12 
13 #include "DelayedFluidSimulator.h"
14 
15 
16 
17 
18 
21 {
23 
24 public:
25 
26  cFloodyFluidSimulator(cWorld & a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, NIBBLETYPE a_Falloff, int a_TickDelay, int a_NumNeighborsForSource);
27 
28 protected:
29 
32 
33  // cDelayedFluidSimulator overrides:
34  virtual void SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override;
35 
37  bool CheckTributaries(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_MyMeta);
38 
40  void SpreadToNeighbor(cChunk * a_NearChunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_NewMeta);
41 
43  bool CheckNeighborsForSource(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ);
44 
47  bool HardenBlock(cChunk * a_Chunk, Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta);
48 
52  virtual void SpreadXZ(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_NewMeta);
53 } ;
54 
55 
56 
57 
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
Definition: Chunk.h:36
cDelayedFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, int a_TickDelay)
bool CheckTributaries(cChunk *a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_MyMeta)
Checks tributaries, if not fed, decreases the block's level and returns true.
bool HardenBlock(cChunk *a_Chunk, Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
Checks if the specified block should harden (Water / Lava interaction) and if so, converts it to a su...
bool CheckNeighborsForSource(cChunk *a_Chunk, int a_RelX, int a_RelY, int a_RelZ)
Checks if there are enough neighbors to create a source at the coords specified; turns into source an...
virtual void SpreadXZ(cChunk *a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_NewMeta)
Spread fluid to XZ neighbors.
virtual void SimulateBlock(cChunk *a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
Called from SimulateChunk() to simulate each block in one slot of blocks.
cFloodyFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid, NIBBLETYPE a_Falloff, int a_TickDelay, int a_NumNeighborsForSource)
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.
Definition: World.h:53