Class ResourceLookupRule<C,V>

java.lang.Object
net.minecraft.util.parsing.packrat.commands.ResourceLookupRule<C,V>
All Implemented Interfaces:
ResourceSuggestion, Rule<com.mojang.brigadier.StringReader, V>, SuggestionSupplier<com.mojang.brigadier.StringReader>
Direct Known Subclasses:
ComponentPredicateParser.ComponentLookupRule, ComponentPredicateParser.ElementLookupRule, ComponentPredicateParser.PredicateLookupRule, ComponentPredicateParser.TagLookupRule

public abstract class ResourceLookupRule<C,V> extends Object implements Rule<com.mojang.brigadier.StringReader, V>, ResourceSuggestion
  • Field Details

    • idParser

      private final NamedRule<com.mojang.brigadier.StringReader, Identifier> idParser
    • context

      protected final C context
    • error

      private final DelayedException<com.mojang.brigadier.exceptions.CommandSyntaxException> error
  • Constructor Details

    • ResourceLookupRule

      protected ResourceLookupRule(NamedRule<com.mojang.brigadier.StringReader, Identifier> idParser, C context)
  • Method Details

    • parse

      public @Nullable V parse(ParseState<com.mojang.brigadier.StringReader> state)
      Specified by:
      parse in interface Rule<C,V>
    • validateElement

      protected abstract V validateElement(com.mojang.brigadier.ImmutableStringReader reader, Identifier id) throws Exception
      Throws:
      Exception