Interface FluidManager
public interface FluidManager
The fluid simulation, registered as a service.
Coordinates are absolute block coordinates in the world identified by its key.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the fluid held by a block,FluidState.empty()if the world is not loaded.voidnotifyBlockChanged(Key world, int x, int y, int z) Tells the simulation a block changed, so the fluids of it and its six neighbours update.booleanplaceSource(Key world, int x, int y, int z, FluidType type) Places a fluid source and lets it spread.booleanremoveFluid(Key world, int x, int y, int z) Removes the fluid of a block and lets the surroundings drain.voidscheduleUpdate(Key world, int x, int y, int z) Schedules the next spreading step of the fluid at a block, if any.
-
Method Details
-
fluidAt
Returns the fluid held by a block,FluidState.empty()if the world is not loaded.- Parameters:
world- the world keyx- the block X coordinatey- the block Y coordinatez- the block Z coordinate- Returns:
- the fluid held by a block,
FluidState.empty()if the world is not loaded - Since:
- 0.1.0
-
placeSource
-
removeFluid
Removes the fluid of a block and lets the surroundings drain.- Parameters:
world- the world keyx- the block X coordinatey- the block Y coordinatez- the block Z coordinate- Returns:
trueif the block held a fluid- Since:
- 0.1.0
-
scheduleUpdate
Schedules the next spreading step of the fluid at a block, if any.- Parameters:
world- the world keyx- the block X coordinatey- the block Y coordinatez- the block Z coordinate- Since:
- 0.1.0
-
notifyBlockChanged
Tells the simulation a block changed, so the fluids of it and its six neighbours update.- Parameters:
world- the world keyx- the block X coordinatey- the block Y coordinatez- the block Z coordinate- Since:
- 0.1.0
-