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
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.serialization.Codec<ApplyBonusCount.BinomialWithBonusCount>private final intThe field for theextraRoundsrecord component.private final floatThe field for theprobabilityrecord component.static final ApplyBonusCount.FormulaType -
Constructor Summary
ConstructorsConstructorDescriptionBinomialWithBonusCount(int extraRounds, float probability) Creates an instance of aBinomialWithBonusCountrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcalculateNewCount(RandomSource p_230965_, int p_230966_, int p_230967_) final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theextraRoundsrecord component.getType()final inthashCode()Returns a hash code value for this object.floatReturns the value of theprobabilityrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
extraRounds
private final int extraRoundsThe field for theextraRoundsrecord component. -
probability
private final float probabilityThe field for theprobabilityrecord component. -
CODEC
-
TYPE
-
-
Constructor Details
-
BinomialWithBonusCount
BinomialWithBonusCount(int extraRounds, float probability) Creates an instance of aBinomialWithBonusCountrecord class.- Parameters:
extraRounds- the value for theextraRoundsrecord componentprobability- the value for theprobabilityrecord component
-
-
Method Details
-
calculateNewCount
- Specified by:
calculateNewCountin interfaceApplyBonusCount.Formula
-
getType
- Specified by:
getTypein 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 theextraRoundsrecord component.- Returns:
- the value of the
extraRoundsrecord component
-
probability
public float probability()Returns the value of theprobabilityrecord component.- Returns:
- the value of the
probabilityrecord component
-