Record Class UniformGenerator
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.UniformGenerator
- All Implemented Interfaces:
LootContextUser
,NumberProvider
public record UniformGenerator(NumberProvider min, NumberProvider max)
extends Record
implements NumberProvider
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<UniformGenerator>
private final NumberProvider
The field for themax
record component.private final NumberProvider
The field for themin
record component. -
Constructor Summary
ConstructorDescriptionUniformGenerator
(NumberProvider min, NumberProvider max) Creates an instance of aUniformGenerator
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic UniformGenerator
between
(float p_165781_, float p_165782_) final boolean
Indicates whether some other object is "equal to" this one.float
getFloat
(LootContext p_165787_) int
getInt
(LootContext p_165784_) Set<LootContextParam<?>>
getType()
final int
hashCode()
Returns a hash code value for this object.max()
Returns the value of themax
record component.min()
Returns the value of themin
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
-
min
The field for themin
record component. -
max
The field for themax
record component. -
CODEC
-
-
Constructor Details
-
UniformGenerator
Creates an instance of aUniformGenerator
record class.- Parameters:
min
- the value for themin
record componentmax
- the value for themax
record component
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceNumberProvider
-
between
-
getInt
- Specified by:
getInt
in interfaceNumberProvider
-
getFloat
- Specified by:
getFloat
in interfaceNumberProvider
-
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)
. -
min
Returns the value of themin
record component.- Returns:
- the value of the
min
record component
-
max
Returns the value of themax
record component.- Returns:
- the value of the
max
record component
-