Record Class Grammar<T>
java.lang.Object
java.lang.Record
net.minecraft.util.parsing.packrat.commands.Grammar<T>
- All Implemented Interfaces:
CommandArgumentParser<T>
public record Grammar<T>(Dictionary<com.mojang.brigadier.StringReader> rules, NamedRule<com.mojang.brigadier.StringReader, T> top)
extends Record
implements CommandArgumentParser<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Dictionary<com.mojang.brigadier.StringReader> The field for therulesrecord component.The field for thetoprecord component. -
Constructor Summary
ConstructorsConstructorDescriptionGrammar(Dictionary<com.mojang.brigadier.StringReader> rules, NamedRule<com.mojang.brigadier.StringReader, T> top) Creates an instance of aGrammarrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.parse(ParseState<com.mojang.brigadier.StringReader> state) parseForCommands(com.mojang.brigadier.StringReader reader) CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> parseForSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder) Dictionary<com.mojang.brigadier.StringReader> rules()Returns the value of therulesrecord component.top()Returns the value of thetoprecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface CommandArgumentParser
mapResult, withCodec
-
Field Details
-
rules
The field for therulesrecord component. -
top
-
-
Constructor Details
-
Grammar
public Grammar(Dictionary<com.mojang.brigadier.StringReader> rules, NamedRule<com.mojang.brigadier.StringReader, T> top) Creates an instance of aGrammarrecord class.- Parameters:
rules- the value for therulesrecord componenttop- the value for thetoprecord component
-
-
Method Details
-
parse
-
parseForCommands
public T parseForCommands(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parseForCommandsin interfaceCommandArgumentParser<T>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseForSuggestions
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> parseForSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder) - Specified by:
parseForSuggestionsin interfaceCommandArgumentParser<T>
-
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). -
rules
Returns the value of therulesrecord component.- Returns:
- the value of the
rulesrecord component
-
top
-