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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BinomialDistributionGenerator>
private final NumberProvider
The field for then
record component.private final NumberProvider
The field for thep
record component. -
Constructor Summary
ConstructorDescriptionCreates an instance of aBinomialDistributionGenerator
record class. -
Method Summary
Modifier and TypeMethodDescriptionbinomial
(int p_165660_, float p_165661_) final boolean
Indicates whether some other object is "equal to" this one.float
getFloat
(LootContext p_165666_) int
getInt
(LootContext p_165663_) Set<LootContextParam<?>>
getType()
final int
hashCode()
Returns a hash code value for this object.n()
Returns the value of then
record component.p()
Returns the value of thep
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
validate
-
Field Details
-
n
The field for then
record component. -
p
The field for thep
record component. -
CODEC
-
-
Constructor Details
-
BinomialDistributionGenerator
Creates an instance of aBinomialDistributionGenerator
record class.- Parameters:
n
- the value for then
record componentp
- the value for thep
record component
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceNumberProvider
-
getInt
- Specified by:
getInt
in interfaceNumberProvider
-
getFloat
- Specified by:
getFloat
in interfaceNumberProvider
-
binomial
-
getReferencedContextParams
- Specified by:
getReferencedContextParams
in 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 then
record component.- Returns:
- the value of the
n
record component
-
p
Returns the value of thep
record component.- Returns:
- the value of the
p
record component
-