Class FluidUnitSet
java.lang.Object
alexiil.mc.lib.attributes.fluid.volume.FluidUnitBase
alexiil.mc.lib.attributes.fluid.volume.FluidUnitSet
Multiple
FluidUnits. This can localise a single amount into multiple different units, for example a
FluidAmount of "4 + 1/3" would localize a string like "4 Buckets and 1 Bottle" if the two available units were
FluidUnit.BUCKET and FluidUnit.BOTTLE.
While it is possible to construct a custom FluidUnitSet it's recommended that you use the one that's built in
to every FluidKey, via FluidKey.unitSet.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancopy()voidcopyFrom(FluidUnitSet other) net.minecraft.text.TextgetAmount(FluidAmount amount, boolean forceLastSingular, net.minecraft.text.Text fluidName, FluidTooltipContext ctx) net.minecraft.text.TextgetEmptyTank(FluidAmount capacity, FluidTooltipContext ctx) net.minecraft.text.TextgetFlowRate(FluidAmount amountPerTick, net.minecraft.text.Text fluidName, FluidTooltipContext ctx) net.minecraft.text.TextgetFullTank(FluidAmount capacity, net.minecraft.text.Text fluidName, FluidTooltipContext ctx) net.minecraft.text.TextgetPartialTank(FluidAmount amount, FluidAmount capacity, net.minecraft.text.Text fluidName, FluidTooltipContext ctx) localizeAmount(FluidAmount amount, boolean forceLastSingular, net.minecraft.text.Text fluidName, FluidTooltipContext ctx) localizeEmptyTank(FluidAmount capacity, FluidTooltipContext ctx) localizeFlowRate(FluidAmount amountPerTick, net.minecraft.text.Text fluidName, FluidTooltipContext ctx) localizeFullTank(FluidAmount capacity, net.minecraft.text.Text fluidName, FluidTooltipContext ctx) localizePartialTank(FluidAmount amount, FluidAmount capacity, net.minecraft.text.Text fluidName, FluidTooltipContext ctx) Methods inherited from class alexiil.mc.lib.attributes.fluid.volume.FluidUnitBase
getAmount, getAmount, getAmount, getAmount, getAmount, getAmount, getAmount, getEmptyTank, getFlowRate, getFlowRate, getFlowRate, getFullTank, getFullTank, getFullTank, getPartialTank, getPartialTank, getPartialTank, getTank, getTank, getTank, getTank, localizeAmount, localizeAmount, localizeAmount, localizeAmount, localizeAmount, localizeAmount, localizeAmount, localizeEmptyTank, localizeFlowRate, localizeFlowRate, localizeFlowRate, localizeFullTank, localizeFullTank, localizeFullTank, localizePartialTank, localizePartialTank, localizePartialTank, localizeTank, localizeTank, localizeTank, localizeTank
-
Constructor Details
-
FluidUnitSet
public FluidUnitSet()
-
-
Method Details
-
copy
-
copyFrom
-
addUnit
- Returns:
- True if the given unit was added, or false if another unit was already present with an amount equal to the given one.
-
getSmallestUnit
- Returns:
- The largest unit in this set. For example if this was [buckets, bottles] then this would return bottles.
-
getLargestUnit
- Returns:
- The largest unit in this set. For example if this was [buckets, bottles] then this would return buckets.
-
localizeAmount
public String localizeAmount(FluidAmount amount, boolean forceLastSingular, @Nullable net.minecraft.text.Text fluidName, FluidTooltipContext ctx) - Specified by:
localizeAmountin classFluidUnitBase
-
getAmount
public net.minecraft.text.Text getAmount(FluidAmount amount, boolean forceLastSingular, @Nullable net.minecraft.text.Text fluidName, FluidTooltipContext ctx) - Specified by:
getAmountin classFluidUnitBase
-
localizeEmptyTank
- Specified by:
localizeEmptyTankin classFluidUnitBase
-
getEmptyTank
- Specified by:
getEmptyTankin classFluidUnitBase
-
localizeFullTank
public String localizeFullTank(FluidAmount capacity, @Nullable net.minecraft.text.Text fluidName, FluidTooltipContext ctx) - Specified by:
localizeFullTankin classFluidUnitBase
-
getFullTank
public net.minecraft.text.Text getFullTank(FluidAmount capacity, @Nullable net.minecraft.text.Text fluidName, FluidTooltipContext ctx) - Specified by:
getFullTankin classFluidUnitBase
-
localizePartialTank
public String localizePartialTank(FluidAmount amount, FluidAmount capacity, @Nullable net.minecraft.text.Text fluidName, FluidTooltipContext ctx) - Specified by:
localizePartialTankin classFluidUnitBase
-
getPartialTank
public net.minecraft.text.Text getPartialTank(FluidAmount amount, FluidAmount capacity, @Nullable net.minecraft.text.Text fluidName, FluidTooltipContext ctx) - Specified by:
getPartialTankin classFluidUnitBase
-
localizeFlowRate
public String localizeFlowRate(FluidAmount amountPerTick, @Nullable net.minecraft.text.Text fluidName, FluidTooltipContext ctx) - Specified by:
localizeFlowRatein classFluidUnitBase
-
getFlowRate
public net.minecraft.text.Text getFlowRate(FluidAmount amountPerTick, @Nullable net.minecraft.text.Text fluidName, FluidTooltipContext ctx) - Specified by:
getFlowRatein classFluidUnitBase
-