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
static record SuggestionProviders.RegisteredSuggestion(ResourceLocation 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 ResourceLocationThe field for thenamerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRegisteredSuggestion(ResourceLocation 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> pContext, com.mojang.brigadier.suggestion.SuggestionsBuilder pBuilder) 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
RegisteredSuggestion(ResourceLocation 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> pContext, com.mojang.brigadier.suggestion.SuggestionsBuilder pBuilder) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getSuggestionsin interfacecom.mojang.brigadier.suggestion.SuggestionProvider<SharedSuggestionProvider>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
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). -
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
-