Interface FluidTemperature
- All Known Subinterfaces:
FluidTemperature.ContinuousFluidTemperature
,FluidTemperature.DiscreteFluidTemperature
public interface FluidTemperature
Base type for fluid temperature. There are 2 types of temperature, only one of which may be implemented:
FluidTemperature.DiscreteFluidTemperature
, forFluidKey
based temperatures.FluidTemperature.ContinuousFluidTemperature
, forFluidVolume
orFluidProperty
based temperatures.
Note that LibNetworkStack doesn't (yet) provide a way to heat or cool fluids directly. As such this is provided for
informational purposes only, and to ensure that each FluidKey
only has a single temperature.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A ContinuousFluidTemperature
can have a range of temperatures for a single fluid.static interface
A DiscreteFluidTemperature
has a single temperature perFluidKey
. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
addTemperatureToTooltip(FluidKey fluid, FluidTooltipContext context, List<net.minecraft.text.Text> tooltip)
default void
addTemperatureToTooltip(FluidVolume fluid, FluidTooltipContext context, List<net.minecraft.text.Text> tooltip)
double
getTemperature(FluidVolume fluid)
static void
validate(FluidTemperature temperature)
Validates that the given temperature is either null or implements exactly 1 ofFluidTemperature.DiscreteFluidTemperature
orFluidTemperature.ContinuousFluidTemperature
.
-
Method Details
-
getTemperature
- Returns:
- The temperature of the fluid, in degrees C.
- Throws:
IllegalArgumentException
- if this temperature scale doesn't apply to the givenFluidVolume
.
-
addTemperatureToTooltip
default void addTemperatureToTooltip(FluidKey fluid, FluidTooltipContext context, List<net.minecraft.text.Text> tooltip) -
addTemperatureToTooltip
default void addTemperatureToTooltip(FluidVolume fluid, FluidTooltipContext context, List<net.minecraft.text.Text> tooltip) -
validate
Validates that the given temperature is either null or implements exactly 1 ofFluidTemperature.DiscreteFluidTemperature
orFluidTemperature.ContinuousFluidTemperature
.
-