Record Class CopyComponentsFunction.DirectSource<T extends DataComponentGetter>
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.functions.CopyComponentsFunction.DirectSource<T>
- All Implemented Interfaces:
LootContextArg<DataComponentGetter>,LootContextArg.Getter<T,DataComponentGetter>
- Enclosing class:
CopyComponentsFunction
static record CopyComponentsFunction.DirectSource<T extends DataComponentGetter>(ContextKey<? extends T extends DataComponentGetter> contextParam)
extends Record
implements LootContextArg.Getter<T,DataComponentGetter>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.level.storage.loot.LootContextArg
LootContextArg.ArgCodecBuilder<R>, LootContextArg.Getter<T,R>, LootContextArg.SimpleGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContextKey<? extends T> The field for thecontextParamrecord component.Fields inherited from interface net.minecraft.world.level.storage.loot.LootContextArg
ENTITY_OR_BLOCK -
Constructor Summary
ConstructorsConstructorDescriptionDirectSource(ContextKey<? extends T> contextParam) Creates an instance of aDirectSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionContextKey<? extends T> Returns the value of thecontextParamrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.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.LootContextArg.Getter
get
-
Field Details
-
contextParam
The field for thecontextParamrecord component.
-
-
Constructor Details
-
DirectSource
DirectSource(ContextKey<? extends T> contextParam) Creates an instance of aDirectSourcerecord class.- Parameters:
contextParam- the value for thecontextParamrecord component
-
-
Method Details
-
get
- Specified by:
getin interfaceLootContextArg.Getter<T extends DataComponentGetter,DataComponentGetter>
-
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). -
contextParam
Returns the value of thecontextParamrecord component.- Specified by:
contextParamin interfaceLootContextArg<T extends DataComponentGetter>- Specified by:
contextParamin interfaceLootContextArg.Getter<T extends DataComponentGetter,DataComponentGetter> - Returns:
- the value of the
contextParamrecord component
-