public static class VariableAmount.OptionalAmount extends VariableAmount
VariableAmount
which it refers to if the
chance succeeds.VariableAmount.BaseAndVariance, VariableAmount.Fixed, VariableAmount.OptionalAmount
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
double |
getAmount(Random rand)
Gets an instance of the variable amount depending on the given random
object.
|
int |
getFlooredAmount(Random rand)
Gets the amount as if from
VariableAmount.getAmount(Random) but floored to the
nearest integer equivalent. |
int |
hashCode() |
DataContainer |
toContainer()
Serializes this object into a comprehensible
DataContainer . |
baseWithOptionalAddition, baseWithOptionalVariance, baseWithRandomAddition, baseWithVariance, fixed, toString
public double getAmount(Random rand)
VariableAmount
getAmount
in class VariableAmount
rand
- The random objectpublic int getFlooredAmount(Random rand)
VariableAmount
VariableAmount.getAmount(Random)
but floored to the
nearest integer equivalent.getFlooredAmount
in class VariableAmount
rand
- The random objectpublic DataContainer toContainer()
DataSerializable
DataContainer
.