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 SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionBinomialWithBonusCount(int extraRounds, float probability) Creates an instance of aBinomialWithBonusCountrecord class.
- 
Method SummaryModifier 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- 
extraRoundsprivate final int extraRoundsThe field for theextraRoundsrecord component.
- 
probabilityprivate final float probabilityThe field for theprobabilityrecord component.
- 
CODEC
- 
TYPE
 
- 
- 
Constructor Details- 
BinomialWithBonusCountBinomialWithBonusCount(int extraRounds, float probability) Creates an instance of aBinomialWithBonusCountrecord class.- Parameters:
- extraRounds- the value for the- extraRoundsrecord component
- probability- the value for the- probabilityrecord component
 
 
- 
- 
Method Details- 
calculateNewCount- Specified by:
- calculateNewCountin interface- ApplyBonusCount.Formula
 
- 
getType- Specified by:
- getTypein interface- ApplyBonusCount.Formula
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
extraRoundspublic int extraRounds()Returns the value of theextraRoundsrecord component.- Returns:
- the value of the extraRoundsrecord component
 
- 
probabilitypublic float probability()Returns the value of theprobabilityrecord component.- Returns:
- the value of the probabilityrecord component
 
 
-