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,ResourceLocation> 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,ResourceLocation> p_410060_, C p_335882_)
  • Method Details

    • parse

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

      protected abstract V validateElement(com.mojang.brigadier.ImmutableStringReader p_335698_, ResourceLocation p_335462_) throws Exception
      Throws:
      Exception