Record Class StorageValue
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.StorageValue
- All Implemented Interfaces:
LootContextUser, NumberProvider, Validatable
public record StorageValue(Identifier storage, NbtPathArgument.NbtPath path)
extends Record
implements NumberProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<StorageValue> private final NbtPathArgument.NbtPathThe field for thepathrecord component.private final IdentifierThe field for thestoragerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionStorageValue(Identifier storage, NbtPathArgument.NbtPath path) Creates an instance of aStorageValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<StorageValue> codec()final booleanIndicates whether some other object is "equal to" this one.floatgetFloat(LootContext context) intgetInt(LootContext context) private NumbergetNumericTag(LootContext context, Number _default) final inthashCode()Returns a hash code value for this object.path()Returns the value of thepathrecord component.storage()Returns the value of thestoragerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface LootContextUser
getReferencedContextParams, validate
-
Field Details
-
storage
The field for thestoragerecord component. -
path
The field for thepathrecord component. -
MAP_CODEC
-
-
Constructor Details
-
StorageValue
Creates an instance of aStorageValuerecord class.- Parameters:
storage- the value for thestoragerecord componentpath- the value for thepathrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceNumberProvider
-
getNumericTag
-
getFloat
- Specified by:
getFloatin interfaceNumberProvider
-
getInt
- Specified by:
getIntin interfaceNumberProvider
-
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). -
storage
Returns the value of thestoragerecord component.- Returns:
- the value of the
storagerecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-