Record Class ApplyBonusCount.UniformBonusCount
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.functions.ApplyBonusCount.UniformBonusCount
- All Implemented Interfaces:
- ApplyBonusCount.Formula
- Enclosing class:
- ApplyBonusCount
static record ApplyBonusCount.UniformBonusCount(int bonusMultiplier)
extends Record
implements ApplyBonusCount.Formula
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final intThe field for thebonusMultiplierrecord component.static final com.mojang.serialization.Codec<ApplyBonusCount.UniformBonusCount>static final ApplyBonusCount.FormulaType
- 
Constructor SummaryConstructorsConstructorDescriptionUniformBonusCount(int bonusMultiplier) Creates an instance of aUniformBonusCountrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the value of thebonusMultiplierrecord component.intcalculateNewCount(RandomSource p_230976_, int p_230977_, int p_230978_) final booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
bonusMultiplierprivate final int bonusMultiplierThe field for thebonusMultiplierrecord component.
- 
CODEC
- 
TYPE
 
- 
- 
Constructor Details- 
UniformBonusCountUniformBonusCount(int bonusMultiplier) Creates an instance of aUniformBonusCountrecord class.- Parameters:
- bonusMultiplier- the value for the- bonusMultiplierrecord 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 '=='.
- 
bonusMultiplierpublic int bonusMultiplier()Returns the value of thebonusMultiplierrecord component.- Returns:
- the value of the bonusMultiplierrecord component
 
 
-