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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<UniformGenerator>private final NumberProviderThe field for themaxrecord component.private final NumberProviderThe field for theminrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionUniformGenerator(NumberProvider min, NumberProvider max) Creates an instance of aUniformGeneratorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic UniformGeneratorbetween(float p_165781_, float p_165782_) final booleanIndicates whether some other object is "equal to" this one.floatgetFloat(LootContext p_165787_) intgetInt(LootContext p_165784_) Set<LootContextParam<?>>getType()final inthashCode()Returns a hash code value for this object.max()Returns the value of themaxrecord component.min()Returns the value of theminrecord 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
-
min
The field for theminrecord component. -
max
The field for themaxrecord component. -
CODEC
-
-
Constructor Details
-
UniformGenerator
Creates an instance of aUniformGeneratorrecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceNumberProvider
-
between
-
getInt
- Specified by:
getIntin interfaceNumberProvider
-
getFloat
- Specified by:
getFloatin interfaceNumberProvider
-
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). -
min
Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-