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
private static record ApplyBonusCount.UniformBonusCount(int bonusMultiplier)
extends Record
implements ApplyBonusCount.Formula
Adds a bonus count based on the enchantment level scaled by a constant multiplier.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thebonusMultiplierrecord component.static final com.mojang.serialization.Codec<ApplyBonusCount.UniformBonusCount> static final ApplyBonusCount.FormulaType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUniformBonusCount(int bonusMultiplier) Creates an instance of aUniformBonusCountrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebonusMultiplierrecord component.intcalculateNewCount(RandomSource random, int count, int level) 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
-
bonusMultiplier
private final int bonusMultiplierThe field for thebonusMultiplierrecord component. -
CODEC
-
TYPE
-
-
Constructor Details
-
UniformBonusCount
private UniformBonusCount(int bonusMultiplier) Creates an instance of aUniformBonusCountrecord class.- Parameters:
bonusMultiplier- the value for thebonusMultiplierrecord component
-
-
Method Details
-
calculateNewCount
- Specified by:
calculateNewCountin interfaceApplyBonusCount.Formula
-
getType
- Specified by:
getTypein interfaceApplyBonusCount.Formula
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
bonusMultiplier
public int bonusMultiplier()Returns the value of thebonusMultiplierrecord component.- Returns:
- the value of the
bonusMultiplierrecord component
-