Enum FluidAmount.FluidMergeRounding
java.lang.Object
java.lang.Enum<FluidAmount.FluidMergeRounding>
alexiil.mc.lib.attributes.fluid.amount.FluidAmount.FluidMergeRounding
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<FluidAmount.FluidMergeRounding>,java.lang.constant.Constable
- Enclosing class:
- FluidAmount
public static enum FluidAmount.FluidMergeRounding extends java.lang.Enum<FluidAmount.FluidMergeRounding>
Specifies how merged
FluidAmount's should handle rounding.-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description FAILSpecifies that any fluid amounts that don't completely fit together should fail.MAXIMUM_POSSIBLEMove only an amount which can be validly moved, leaving the rest in the source.ROUND_CEILINGAlways empty the source, but leave the target with (potentially) slightly different amount fluid than the exact sum of the two volumes.ROUND_DOWNAlways empty the source, but leave the target with (potentially) slightly less fluid than the exact sum of the two volumes.ROUND_FLOORAlways empty the source, but leave the target with (potentially) slightly different amount fluid than the exact sum of the two volumes.ROUND_HALF_DOWNAlways empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.ROUND_HALF_EVENAlways empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.ROUND_HALF_UPAlways empty the source, but leave the target with (potentially) slightly different amount of fluid than the exact sum of the two volumes.ROUND_UNNECESSARYThrow anArithmeticExceptionif the end result needs to be rounded.ROUND_UPAlways empty the source, but leave the target with (potentially) slightly more fluid than the exact sum of the two volumes. -
Field Summary
Fields Modifier and Type Field Description static FluidAmount.FluidMergeRoundingDEFAULTjava.math.RoundingModeroundingThe rounding mode to use, or null if this requires special handling. -
Method Summary
Modifier and Type Method Description static FluidAmount.FluidMergeRoundingfromRounding(java.math.RoundingMode rounding)static FluidAmount.FluidMergeRoundingvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static FluidAmount.FluidMergeRounding[]values()Returns an array containing the constants of this enum type, 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 aRoundingModeofUP. -
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 aRoundingModeofDOWN. -
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 aRoundingModeofUP. -
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 aRoundingModeofFLOOR. -
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 aRoundingModeofHALF_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 aRoundingModeofHALF_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 aRoundingModeofHALF_EVEN. -
ROUND_UNNECESSARY
Throw anArithmeticExceptionif the end result needs to be rounded.
-
-
Field Details
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
fromRounding
public static FluidAmount.FluidMergeRounding fromRounding(@Nullable java.math.RoundingMode rounding)
-