General Mechanics adds a large library of industrial fluids, each modeled with a real chemical formula, a temperature in Kelvin, and optional acidity/basicity flags. Fluids are registered in CoreFluids and are available as fluid blocks, bucket items, and inputs for fluid-based recipes.
Acidic fluids (Sulfuric Acid, Hydrochloric Acid, Nitric Acid) are flagged with isAcidic = true. Handle them carefully in automation — future gameplay mechanics may implement corrosion or damage to machines and players that come into contact with these fluids.
Registration
Every fluid is registered with a single registerFluid() call that produces four objects:
- A
FluidType (via CoreFluidTypes)
- A source
FlowingFluid and a flowing FlowingFluid
- A
LiquidBlock for world placement
- A
BucketItem that stacks to 1 and returns an empty bucket on use
public static FluidDefinition registerFluid(
String englishName,
int tintColor,
Vector3f fogColor,
String chemicalFormula,
boolean isAcidic,
boolean isBasic,
long temp // Kelvin
) { ... }
The overload without isAcidic, isBasic, and temp defaults to false, false, 298L (room temperature, neutral).
Each fluid’s bucket item and fluid block are registered with a Formula record that stores the chemical formula string:
public record Formula(@NotNull ItemLike itemLike, @NotNull String formula) {
public Component getFormulaComponent(boolean colored, boolean italic) { ... }
public Component getFormulaComponent() { ... } // colored yellow, not italic
}
Formulas are stored in CoreFormulas keyed by the item’s translation key. The formula is displayed as a tooltip on the bucket and fluid block items.
Fluid Categories
Petroleum Derivatives
Raw and refined hydrocarbon fuels. Default temperature (298 K), neutral.
| Fluid | Formula | Tint |
|---|
| Crude Oil | C₁₂H₂₃ | Very dark brown |
| Refined Oil | C₁₀H₂₂ | Dark brown |
| Gasoline | C₈H₁₈ | Amber orange |
| Diesel | C₁₂H₂₃ | Yellow |
| Kerosene | C₁₂H₂₆ | Light yellow |
| Naphtha | C₇H₁₆ | Sandy gold |
Alcohols and Solvents
Common organic solvents, all at 298 K.
| Fluid | Formula | Basic |
|---|
| Methanol | CH₃OH | Yes |
| Ethanol | C₂H₅OH | Yes |
| Acetone | C₃H₆O | Yes |
| Glycerol | C₃H₈O₃ | Yes |
Aromatics and Hydrocarbon Feedstocks
Industrial feedstocks for polymer and chemical production. Gaseous feedstocks (Ethylene, Propylene, Butadiene) are stored at 273 K.
| Fluid | Formula |
|---|
| Benzene | C₆H₆ |
| Toluene | C₇H₈ |
| Xylene | C₈H₁₀ |
| Ethylene | C₂H₄ |
| Propylene | C₃H₆ |
| Butadiene | C₄H₆ |
| Styrene | C₈H₈ |
Acids and Bases
| Fluid | Formula | Acidic | Basic | Temp (K) |
|---|
| Sulfuric Acid | H₂SO₄ | Yes | No | 298 |
| Hydrochloric Acid | HCl | Yes | No | 298 |
| Nitric Acid | HNO₃ | Yes | No | 298 |
| Ammonia | NH₃ | No | Yes | 298 |
| Liquid Ammonia | NH₃(l) | No | Yes | 240 |
Elements and Gases
Pure elemental fluids stored at cryogenic temperatures reflecting real boiling points.
| Fluid | Formula | Temp (K) |
|---|
| Hydrogen | H₂ | 20 |
| Oxygen | O₂ | 90 |
| Nitrogen | N₂ | 77 |
| Carbon Monoxide | CO | 82 |
| Carbon Dioxide | CO₂ | 195 |
Water Variants and Cryogenics
| Fluid | Formula | Notes |
|---|
| Distilled Water | H₂O | Purified, 298 K |
| Heavy Water | D₂O | Deuterium oxide, 298 K |
| Steam | H₂O(g) | 373 K |
| Liquid Nitrogen | N₂(l) | 77 K |
| Liquid Oxygen | O₂(l) | 90 K |
FluidDefinition Record
FluidDefinition bundles all four registered objects for a fluid:
FluidDefinition definition = new FluidDefinition(
englishName, // display name
type, // Supplier<FluidType>
SOURCE, // Supplier<FlowingFluid> — source fluid
FLOWING, // Supplier<FlowingFluid> — flowing fluid
BLOCK, // BlockDefinition<LiquidBlock>
BUCKET // ItemDefinition<BucketItem>
);
All registered fluids are accessible via CoreFluids.getFluids().
Fluid Mixing
Fluids serve as inputs in fluid-based crafting recipes. Buckets of the appropriate fluid can be placed into machine input slots, or piped in via NeoForge fluid capabilities. Specific recipe types that consume fluids will be documented alongside the machines that process them.