Record Class ResolvableFloat.Reference
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.floats.ResolvableFloat.Reference
- All Implemented Interfaces:
ResolvableFloat
- Enclosing interface:
ResolvableFloat
public static record ResolvableFloat.Reference(ResourceKey<ContextFloatProvider> key)
extends Record
implements ResolvableFloat
-
Nested Class Summary
Nested classes/interfaces inherited from interface ResolvableFloat
ResolvableFloat.Constant, ResolvableFloat.Reference -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.serialization.Codec<ResolvableFloat.Reference> private final ResourceKey<ContextFloatProvider> The field for thekeyrecord component.private static final StreamCodec<io.netty.buffer.ByteBuf, ResolvableFloat.Reference> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aReferencerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.floatget(LootContext context, float defaultValue) private Optional<ContextFloatProvider> getProvider(LootContext context) final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
key
The field for thekeyrecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
Reference
Creates an instance of aReferencerecord class.- Parameters:
key- the value for thekeyrecord component
-
-
Method Details
-
get
- Specified by:
getin interfaceResolvableFloat
-
getProvider
-
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 withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-