Search in sources :

Example 1 with FluidProperty

use of gregtech.api.unification.material.properties.FluidProperty in project GregTech by GregTechCEu.

the class MetaFluids method init.

public static void init() {
    fluidSprites.add(AUTO_GENERATED_PLASMA_TEXTURE);
    registerIconFluidSprites();
    // handle vanilla fluids
    handleNonMaterialFluids(Materials.Water, FluidRegistry.WATER);
    handleNonMaterialFluids(Materials.Lava, FluidRegistry.LAVA);
    // alternative names for forestry fluids
    addAlternativeNames();
    // set custom textures for fluids
    setCustomTextures();
    for (Material material : GregTechAPI.MATERIAL_REGISTRY) {
        FluidProperty fluidProperty = material.getProperty(PropertyKey.FLUID);
        if (fluidProperty != null && fluidProperty.getFluid() == null) {
            int temperature = Math.max(material.getBlastTemperature(), fluidProperty.getFluidTemperature());
            Fluid fluid = registerFluid(material, fluidProperty.getFluidType(), temperature, fluidProperty.hasBlock());
            fluidProperty.setFluid(fluid);
            fluidProperty.setFluidTemperature(fluid.getTemperature(), fluid.getTemperature() >= 0);
        }
        PlasmaProperty plasmaProperty = material.getProperty(PropertyKey.PLASMA);
        if (plasmaProperty != null && plasmaProperty.getPlasma() == null) {
            int temperature = (fluidProperty == null ? 0 : fluidProperty.getFluidTemperature()) + 30000;
            Fluid fluid = registerFluid(material, FluidTypes.PLASMA, temperature, false);
            plasmaProperty.setPlasma(fluid);
        }
    }
}
Also used : FluidProperty(gregtech.api.unification.material.properties.FluidProperty) Fluid(net.minecraftforge.fluids.Fluid) Material(gregtech.api.unification.material.Material) PlasmaProperty(gregtech.api.unification.material.properties.PlasmaProperty)

Aggregations

Material (gregtech.api.unification.material.Material)1 FluidProperty (gregtech.api.unification.material.properties.FluidProperty)1 PlasmaProperty (gregtech.api.unification.material.properties.PlasmaProperty)1 Fluid (net.minecraftforge.fluids.Fluid)1