Class WorldFluids
java.lang.Object
fr.robie.machineengine.api.paper.WorldFluids
Fluids in the world (D46): which fluid a block holds, where a fluid may go, and the settings in
effect (a fluid's definition with the server owner's
fluids.yml on top). Call it on the
block's thread.
Until MachineEngine's world fluids run (headless tests, or world-fluids.enabled: false)
only vanilla water and lava are known: they may go into air or their own flowing block, and no
placeable fluid can be placed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceWhat MachineEngine installs when world fluids run.static final recordWhether a fluid may go somewhere, and if not, why. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ResourceTypeat(@NotNull org.bukkit.block.Block block) The fluid inblock: a placeable fluid MachineEngine tracks, vanilla water (also in a waterlogged block) or lava;nullfor none.static @NotNull WorldFluids.PlacementWhetherfluidmay be placed in or flow intoblock(the same rules buckets and spreading follow).static @NotNull List<FluidEffect> The effects in effect forfluid.static @NotNull FluidLookThe look in effect forfluid.static @NotNull FluidMixingThe mixing rules in effect forfluid.static @NotNull FluidPhysicsThe physics in effect forfluid(its definition, overridden byfluids.yml).static booleanstatic booleanplace(@NotNull org.bukkit.block.Block block, @NotNull FluidType fluid, @NotNull WorldFluidPlaceEvent.Cause cause) place(Block, FluidType)with the cause the event reports (a machine, a command …).static voidsetAccess(@Nullable WorldFluids.Access value) static @Nullable ResourceTypetake(@NotNull org.bukkit.block.Block block) Removes the fluid source inblock.static @Nullable ResourceTypetake(@NotNull org.bukkit.block.Block block, @NotNull WorldFluidRemoveEvent.Cause cause) take(Block)with the cause the event reports.static @NotNull WorldFluids.AccessWhat answers while MachineEngine's world fluids don't run: vanilla water and lava only.
-
Method Details
-
vanillaOnly
What answers while MachineEngine's world fluids don't run: vanilla water and lava only. -
setAccess
-
at
The fluid inblock: a placeable fluid MachineEngine tracks, vanilla water (also in a waterlogged block) or lava;nullfor none. -
canPlace
@NotNull public static @NotNull WorldFluids.Placement canPlace(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull FluidType fluid) Whetherfluidmay be placed in or flow intoblock(the same rules buckets and spreading follow). -
place
public static boolean place(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull FluidType fluid) - Returns:
- whether it was placed
-
place
public static boolean place(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull FluidType fluid, @NotNull WorldFluidPlaceEvent.Cause cause) place(Block, FluidType)with the cause the event reports (a machine, a command …). -
take
Removes the fluid source inblock.- Returns:
- the fluid taken, or
nullif the block held no source
-
take
@Nullable public static @Nullable ResourceType take(@NotNull @NotNull org.bukkit.block.Block block, @NotNull WorldFluidRemoveEvent.Cause cause) take(Block)with the cause the event reports. -
physics
The physics in effect forfluid(its definition, overridden byfluids.yml). -
look
-
mixing
The mixing rules in effect forfluid. -
effects
The effects in effect forfluid.
-