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 thedelegate
record component.private final ResourceLocation
The field for thename
record component. -
Constructor Summary
ConstructorsConstructorDescriptionRegisteredSuggestion
(ResourceLocation name, com.mojang.brigadier.suggestion.SuggestionProvider<SharedSuggestionProvider> delegate) Creates an instance of aRegisteredSuggestion
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.brigadier.suggestion.SuggestionProvider
<SharedSuggestionProvider> delegate()
Returns the value of thedelegate
record component.final boolean
Indicates whether some other object is "equal to" this one.CompletableFuture
<com.mojang.brigadier.suggestion.Suggestions> getSuggestions
(com.mojang.brigadier.context.CommandContext<SharedSuggestionProvider> p_425736_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_425858_) final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
name
The field for thename
record component. -
delegate
The field for thedelegate
record component.
-
-
Constructor Details
-
RegisteredSuggestion
RegisteredSuggestion(ResourceLocation name, com.mojang.brigadier.suggestion.SuggestionProvider<SharedSuggestionProvider> delegate) Creates an instance of aRegisteredSuggestion
record class.- Parameters:
name
- the value for thename
record componentdelegate
- the value for thedelegate
record component
-
-
Method Details
-
getSuggestions
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> getSuggestions(com.mojang.brigadier.context.CommandContext<SharedSuggestionProvider> p_425736_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_425858_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getSuggestions
in 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 thename
record component.- Returns:
- the value of the
name
record component
-
delegate
Returns the value of thedelegate
record component.- Returns:
- the value of the
delegate
record component
-