Enum Class FluidAmount.FluidMergeRounding
java.lang.Object
java.lang.Enum<FluidAmount.FluidMergeRounding>
alexiil.mc.lib.attributes.fluid.amount.FluidAmount.FluidMergeRounding
- All Implemented Interfaces:
Serializable
,Comparable<FluidAmount.FluidMergeRounding>
,Constable
- Enclosing class:
- FluidAmount
Specifies how merged
FluidAmount
's should handle rounding.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSpecifies that any fluid amounts that don't completely fit together should fail.Move only an amount which can be validly moved, leaving the rest in the source.Always empty the source, but leave the target with (potentially) slightly different amount fluid than the exact sum of the two volumes.Always empty the source, but leave the target with (potentially) slightly less fluid than the exact sum of the two volumes.Always empty the source, but leave the target with (potentially) slightly different amount fluid than the exact sum of the two volumes.Always empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.Always empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.Always empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.Throw anArithmeticException
if the end result needs to be rounded.Always empty the source, but leave the target with (potentially) slightly more fluid than the exact sum of the two volumes. -
Field Summary
Modifier and TypeFieldDescriptionThe rounding mode to use, or null if this requires special handling. -
Method Summary
Modifier and TypeMethodDescriptionfromRounding(RoundingMode rounding)
Returns the enum constant of this class with the specified name.static FluidAmount.FluidMergeRounding[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FAIL
Specifies that any fluid amounts that don't completely fit together should fail. -
MAXIMUM_POSSIBLE
Move only an amount which can be validly moved, leaving the rest in the source. (As such fluid will never be lost, but you might get some leftovers). -
ROUND_UP
Always empty the source, but leave the target with (potentially) slightly more fluid than the exact sum of the two volumes.Use
FluidAmount.safeAdd(FluidAmount, RoundingMode)
with aRoundingMode
ofUP
. -
ROUND_DOWN
Always empty the source, but leave the target with (potentially) slightly less fluid than the exact sum of the two volumes.Use
FluidAmount.safeAdd(FluidAmount, RoundingMode)
with aRoundingMode
ofDOWN
. -
ROUND_CEILING
Always empty the source, but leave the target with (potentially) slightly different amount fluid than the exact sum of the two volumes.Use
FluidAmount.safeAdd(FluidAmount, RoundingMode)
with aRoundingMode
ofUP
. -
ROUND_FLOOR
Always empty the source, but leave the target with (potentially) slightly different amount fluid than the exact sum of the two volumes.Use
FluidAmount.safeAdd(FluidAmount, RoundingMode)
with aRoundingMode
ofFLOOR
. -
ROUND_HALF_UP
Always empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.Use
FluidAmount.safeAdd(FluidAmount, RoundingMode)
with aRoundingMode
ofHALF_UP
. -
ROUND_HALF_DOWN
Always empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.Use
FluidAmount.safeAdd(FluidAmount, RoundingMode)
with aRoundingMode
ofHALF_DOWN
. -
ROUND_HALF_EVEN
Always empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.Use
FluidAmount.safeAdd(FluidAmount, RoundingMode)
with aRoundingMode
ofHALF_EVEN
. -
ROUND_UNNECESSARY
Throw anArithmeticException
if the end result needs to be rounded.
-
-
Field Details
-
DEFAULT
-
rounding
The rounding mode to use, or null if this requires special handling.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromRounding
-