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