Package net.minecraft.commands.functions
Record Class PlainTextFunction<T>
java.lang.Object
java.lang.Record
net.minecraft.commands.functions.PlainTextFunction<T>
- All Implemented Interfaces:
CommandFunction<T>,InstantiatedFunction<T>
public record PlainTextFunction<T>(ResourceLocation id, List<UnboundEntryAction<T>> entries)
extends Record
implements CommandFunction<T>, InstantiatedFunction<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<UnboundEntryAction<T>> The field for theentriesrecord component.private final ResourceLocationThe field for theidrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPlainTextFunction(ResourceLocation id, List<UnboundEntryAction<T>> entries) Creates an instance of aPlainTextFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionentries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.instantiate(CompoundTag p_306181_, com.mojang.brigadier.CommandDispatcher<T> p_306210_) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
id
The field for theidrecord component. -
entries
The field for theentriesrecord component.
-
-
Constructor Details
-
PlainTextFunction
Creates an instance of aPlainTextFunctionrecord class.- Parameters:
id- the value for theidrecord componententries- the value for theentriesrecord component
-
-
Method Details
-
instantiate
public InstantiatedFunction<T> instantiate(@Nullable CompoundTag p_306181_, com.mojang.brigadier.CommandDispatcher<T> p_306210_) throws FunctionInstantiationException - Specified by:
instantiatein interfaceCommandFunction<T>- Throws:
FunctionInstantiationException
-
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). -
id
Returns the value of theidrecord component.- Specified by:
idin interfaceCommandFunction<T>- Specified by:
idin interfaceInstantiatedFunction<T>- Returns:
- the value of the
idrecord component
-
entries
Returns the value of theentriesrecord component.- Specified by:
entriesin interfaceInstantiatedFunction<T>- Returns:
- the value of the
entriesrecord component
-