Class Fluids

java.lang.Object
fr.robie.machineengine.api.resource.Fluids

public final class Fluids extends Object
Fluids: one global category, machineengine:fluid, for every addon and definition (D29). MachineEngine registers water and lava; addons create their own fluids in the same category with create(Key), so a pipe or port accepting any() moves every registered fluid. Fluid keys are <namespace>:fluid/<name>.

The unit, scale and bucket size are set in config.yml (resources.fluid) and read when the fluids are built.

  • Field Details

    • CATEGORY_KEY

      public static final net.kyori.adventure.key.Key CATEGORY_KEY
    • WATER_KEY

      public static final net.kyori.adventure.key.Key WATER_KEY
    • LAVA_KEY

      public static final net.kyori.adventure.key.Key LAVA_KEY
    • WORLD_WATER

      public static final net.kyori.adventure.key.Key WORLD_WATER
      The world fluids, as WorldFluid and the MachineWorld fluid calls name them.
    • WORLD_LAVA

      public static final net.kyori.adventure.key.Key WORLD_LAVA
    • UNIT

      public static final ConfigKey<String> UNIT
    • SCALE

      public static final ConfigKey<Integer> SCALE
    • BUCKET

      public static final ConfigKey<Long> BUCKET
    • WATER_COLOR

      public static final ConfigKey<Integer> WATER_COLOR
      Vanilla's default water color; the menus' tint of water.
    • LAVA_COLOR

      public static final ConfigKey<Integer> LAVA_COLOR
  • Method Details

    • category

      @NotNull public static @NotNull ResourceCategory category()
      The category machineengine:fluid, with the configured unit and scale.
    • water

      @NotNull public static @NotNull ResourceType water()
      machineengine:fluid/water.
    • lava

      @NotNull public static @NotNull ResourceType lava()
      machineengine:fluid/lava.
    • bucket

      public static long bucket()
      The amount of fluid in one bucket.
    • any

      @NotNull public static @NotNull ResourcePredicate any()
      Matches every fluid.
    • create

      @NotNull public static @NotNull ResourceType create(@NotNull @NotNull net.kyori.adventure.key.Key key)
      A new fluid in the global category, e.g. Fluids.create(Key.key("mymod", "fluid/oil")). Register it with context.resourceTypes().register(...) like any resource type.
    • create

      @NotNull public static @NotNull ResourceType create(@NotNull @NotNull net.kyori.adventure.key.Key key, int color)
      A new fluid with a menu color (0xRRGGBB), as create(Key).
    • isFluid

      public static boolean isFluid(@NotNull @NotNull ResourceType type)
      Whether type is in the global fluid category.
    • worldFluid

      @Nullable public static @Nullable net.kyori.adventure.key.Key worldFluid(@NotNull @NotNull ResourceType type)
      The world fluid (minecraft:water or minecraft:lava) of a fluid; null for fluids with no block.
    • fromWorld

      @Nullable public static @Nullable ResourceType fromWorld(@NotNull @NotNull net.kyori.adventure.key.Key worldFluid)
      The fluid of a world fluid (minecraft:water or minecraft:lava); null for others.