Record Class SuggestionProviders.RegisteredSuggestion
java.lang.Object
java.lang.Record
net.minecraft.commands.synchronization.SuggestionProviders.RegisteredSuggestion
- All Implemented Interfaces:
SuggestionProvider<SharedSuggestionProvider>
- Enclosing class:
SuggestionProviders
private static record SuggestionProviders.RegisteredSuggestion(Identifier name, SuggestionProvider<SharedSuggestionProvider> delegate)
extends Record
implements SuggestionProvider<SharedSuggestionProvider>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SuggestionProvider<SharedSuggestionProvider> The field for thedelegaterecord component.private final IdentifierThe field for thenamerecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRegisteredSuggestion(Identifier name, SuggestionProvider<SharedSuggestionProvider> delegate) Creates an instance of aRegisteredSuggestionrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondelegate()Returns the value of thedelegaterecord component.final booleanIndicates whether some other object is "equal to" this one.getSuggestions(CommandContext<SharedSuggestionProvider> context, SuggestionsBuilder builder) final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
name
The field for thenamerecord component. -
delegate
The field for thedelegaterecord component.
-
-
Constructor Details
-
RegisteredSuggestion
private RegisteredSuggestion(Identifier name, SuggestionProvider<SharedSuggestionProvider> delegate) Creates an instance of aRegisteredSuggestionrecord class.- Parameters:
name- the value for thenamerecord componentdelegate- the value for thedelegaterecord component
-
-
Method Details
-
getSuggestions
public CompletableFuture<Suggestions> getSuggestions(CommandContext<SharedSuggestionProvider> context, SuggestionsBuilder builder) throws CommandSyntaxException - Specified by:
getSuggestionsin interfaceSuggestionProvider<SharedSuggestionProvider>- Throws:
CommandSyntaxException
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
delegate
Returns the value of thedelegaterecord component.- Returns:
- the value of the
delegaterecord component
-