Class WorldFluids

java.lang.Object
fr.robie.machineengine.api.paper.WorldFluids

public final class WorldFluids extends Object
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.

  • Method Details

    • vanillaOnly

      @Internal @NotNull public static @NotNull WorldFluids.Access vanillaOnly()
      What answers while MachineEngine's world fluids don't run: vanilla water and lava only.
    • setAccess

      @Internal public static void setAccess(@Nullable @Nullable WorldFluids.Access value)
    • at

      @Nullable public static @Nullable ResourceType at(@NotNull @NotNull org.bukkit.block.Block block)
      The fluid in block: a placeable fluid MachineEngine tracks, vanilla water (also in a waterlogged block) or lava; null for none.
    • canPlace

      @NotNull public static @NotNull WorldFluids.Placement canPlace(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull FluidType fluid)
      Whether fluid may be placed in or flow into block (the same rules buckets and spreading follow).
    • place

      public static boolean place(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull FluidType fluid)
      Places a source of fluid in block (air, or flowing fluid), firing WorldFluidPlaceEvent.
      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

      @Nullable public static @Nullable ResourceType take(@NotNull @NotNull org.bukkit.block.Block block)
      Removes the fluid source in block.
      Returns:
      the fluid taken, or null if 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

      @NotNull public static @NotNull FluidPhysics physics(@NotNull @NotNull FluidType fluid)
      The physics in effect for fluid (its definition, overridden by fluids.yml).
    • look

      @NotNull public static @NotNull FluidLook look(@NotNull @NotNull FluidType fluid)
      The look in effect for fluid.
    • mixing

      @NotNull public static @NotNull FluidMixing mixing(@NotNull @NotNull FluidType fluid)
      The mixing rules in effect for fluid.
    • effects

      @NotNull public static @NotNull List<FluidEffect> effects(@NotNull @NotNull FluidType fluid)
      The effects in effect for fluid.