Interface FluidManager
public interface FluidManager
The fluid simulation, registered as a service.
Changes are made on the thread of the region owning the block.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionfluidAt(World world, BlockPosition position) Returns the fluid held by a block.booleanplaceSource(World world, BlockPosition position, TypedKey<Fluid> fluid) Places a source of fluid, which then spreads: the block it replaces breaks and drops what it would drop, unless it is air or the source fills a waterloggable block.booleanremoveFluid(World world, BlockPosition position) Takes the fluid out of a block, the way a bucket does: a fluid block turns into air, a waterlogged block dries.voidscheduleUpdate(World world, BlockPosition position) Schedules a tick for the fluid of a block, due as soon as that fluid ticks, if the block holds one.
-
Method Details
-
fluidAt
Returns the fluid held by a block.: the fluid of a fluid block, the water of a waterlogged block or of a block always under water; an empty state for any other block or one that is not loaded- Parameters:
world- the worldposition- the block- Returns:
- the fluid held by a block
- Since:
- 0.1.0
-
placeSource
Places a source of fluid, which then spreads: the block it replaces breaks and drops what it would drop, unless it is air or the source fills a waterloggable block.- Parameters:
world- the worldposition- the blockfluid- the fluid,FluidKeys.WATERorFluidKeys.LAVA- Returns:
trueif the source was placed- Throws:
IllegalArgumentException- if the fluid is neither water nor lava- Since:
- 0.1.0
-
removeFluid
Takes the fluid out of a block, the way a bucket does: a fluid block turns into air, a waterlogged block dries. The fluid around then drains.- Parameters:
world- the worldposition- the block- Returns:
trueif the block held a fluid that could be taken- Since:
- 0.1.0
-
scheduleUpdate
Schedules a tick for the fluid of a block, due as soon as that fluid ticks, if the block holds one.- Parameters:
world- the worldposition- the block- Since:
- 0.1.0
-