Record Class ApplyBonusCount.BinomialWithBonusCount
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.functions.ApplyBonusCount.BinomialWithBonusCount
- All Implemented Interfaces:
ApplyBonusCount.Formula
- Enclosing class:
- ApplyBonusCount
static record ApplyBonusCount.BinomialWithBonusCount(int extraRounds, float probability)
extends Record
implements ApplyBonusCount.Formula
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final com.mojang.serialization.Codec<ApplyBonusCount.BinomialWithBonusCount>
private final int
The field for theextraRounds
record component.private final float
The field for theprobability
record component.static final ApplyBonusCount.FormulaType
-
Constructor Summary
ConstructorDescriptionBinomialWithBonusCount
(int extraRounds, float probability) Creates an instance of aBinomialWithBonusCount
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
calculateNewCount
(RandomSource p_230965_, int p_230966_, int p_230967_) final boolean
Indicates whether some other object is "equal to" this one.int
Returns the value of theextraRounds
record component.getType()
final int
hashCode()
Returns a hash code value for this object.float
Returns the value of theprobability
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
extraRounds
private final int extraRoundsThe field for theextraRounds
record component. -
probability
private final float probabilityThe field for theprobability
record component. -
CODEC
-
TYPE
-
-
Constructor Details
-
BinomialWithBonusCount
BinomialWithBonusCount(int extraRounds, float probability) Creates an instance of aBinomialWithBonusCount
record class.- Parameters:
extraRounds
- the value for theextraRounds
record componentprobability
- the value for theprobability
record component
-
-
Method Details
-
calculateNewCount
- Specified by:
calculateNewCount
in interfaceApplyBonusCount.Formula
-
getType
- Specified by:
getType
in interfaceApplyBonusCount.Formula
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
extraRounds
public int extraRounds()Returns the value of theextraRounds
record component.- Returns:
- the value of the
extraRounds
record component
-
probability
public float probability()Returns the value of theprobability
record component.- Returns:
- the value of the
probability
record component
-