Record Class BinomialDistributionGenerator
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.BinomialDistributionGenerator
- All Implemented Interfaces:
LootContextUser,NumberProvider
public record BinomialDistributionGenerator(NumberProvider n, NumberProvider p)
extends Record
implements NumberProvider
A number provider which generates a random number based on a binomial distribution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BinomialDistributionGenerator> private final NumberProviderThe field for thenrecord component.private final NumberProviderThe field for theprecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aBinomialDistributionGeneratorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbinomial(int pN, float pP) final booleanIndicates whether some other object is "equal to" this one.floatgetFloat(LootContext pLootContext) intgetInt(LootContext pLootContext) Set<LootContextParam<?>> getType()final inthashCode()Returns a hash code value for this object.n()Returns the value of thenrecord component.p()Returns the value of theprecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
validate
-
Field Details
-
n
The field for thenrecord component. -
p
The field for theprecord component. -
CODEC
-
-
Constructor Details
-
BinomialDistributionGenerator
Creates an instance of aBinomialDistributionGeneratorrecord class.- Parameters:
n- the value for thenrecord componentp- the value for theprecord component
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceNumberProvider
-
getInt
- Specified by:
getIntin interfaceNumberProvider
-
getFloat
- Specified by:
getFloatin interfaceNumberProvider
-
binomial
-
getReferencedContextParams
- Specified by:
getReferencedContextParamsin interfaceLootContextUser
-
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 withObjects::equals(Object,Object). -
n
Returns the value of thenrecord component.- Returns:
- the value of the
nrecord component
-
p
Returns the value of theprecord component.- Returns:
- the value of the
precord component
-