Class Fluids
java.lang.Object
fr.robie.machineengine.api.resource.Fluids
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final net.kyori.adventure.key.Keystatic final net.kyori.adventure.key.KeyVanilla's default water color; the menus' tint of water.static final net.kyori.adventure.key.Keystatic final net.kyori.adventure.key.Keystatic final net.kyori.adventure.key.KeyThe world fluids, asWorldFluidand theMachineWorldfluid calls name them. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ResourcePredicateany()Matches every fluid.static longbucket()The amount of fluid in one bucket.static @NotNull ResourceCategorycategory()The categorymachineengine:fluid, with the configured unit and scale.static @NotNull ResourceTypecreate(@NotNull net.kyori.adventure.key.Key key) A new fluid in the global category, e.g.static @NotNull ResourceTypecreate(@NotNull net.kyori.adventure.key.Key key, int color) A new fluid with a menu color (0xRRGGBB), ascreate(Key).static @Nullable ResourceTypefromWorld(@NotNull net.kyori.adventure.key.Key worldFluid) The fluid of a world fluid (minecraft:waterorminecraft:lava);nullfor others.static booleanisFluid(@NotNull ResourceType type) Whethertypeis in the global fluid category.static @NotNull ResourceTypelava()machineengine:fluid/lava.static @NotNull ResourceTypewater()machineengine:fluid/water.static @Nullable net.kyori.adventure.key.KeyworldFluid(@NotNull ResourceType type) The world fluid (minecraft:waterorminecraft:lava) of a fluid;nullfor fluids with no block.
-
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_WATERThe world fluids, asWorldFluidand theMachineWorldfluid calls name them. -
WORLD_LAVA
public static final net.kyori.adventure.key.Key WORLD_LAVA -
UNIT
-
SCALE
-
BUCKET
-
WATER_COLOR
-
LAVA_COLOR
-
-
Method Details
-
category
The categorymachineengine:fluid, with the configured unit and scale. -
water
machineengine:fluid/water. -
lava
machineengine:fluid/lava. -
bucket
public static long bucket()The amount of fluid in one bucket. -
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 withcontext.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), ascreate(Key). -
isFluid
Whethertypeis in the global fluid category. -
worldFluid
@Nullable public static @Nullable net.kyori.adventure.key.Key worldFluid(@NotNull @NotNull ResourceType type) The world fluid (minecraft:waterorminecraft:lava) of a fluid;nullfor 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:waterorminecraft:lava);nullfor others.
-