Interface TextSearcher<T>


@Environment(CLIENT) public interface TextSearcher<T>
A functional interface that allows searching with a text.
Mappings:
Namespace Name
official flg
intermediary net/minecraft/class_7454
named net/minecraft/client/search/TextSearcher
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> TextSearcher<T>
    of()
    Returns a searcher that always returns no results.
    static <T> TextSearcher<T>
    of(List<T> values, Function<T,Stream<String>> textsGetter)
    Returns a searcher that searches from values.
    search(String text)
    Returns the results of searching with the provided text.
  • Method Details

    • of

      static <T> TextSearcher<T> of()
      Returns a searcher that always returns no results.
      Returns:
      a searcher that always returns no results
      Mappings:
      Namespace Name Mixin selector
      official a Lflg;a()Lflg;
      intermediary method_43793 Lnet/minecraft/class_7454;method_43793()Lnet/minecraft/class_7454;
      named of Lnet/minecraft/client/search/TextSearcher;of()Lnet/minecraft/client/search/TextSearcher;
    • of

      static <T> TextSearcher<T> of(List<T> values, Function<T,Stream<String>> textsGetter)
      Returns a searcher that searches from values.
      Parameters:
      textsGetter - a function that, when given a value from values, returns a stream of search texts associated with the value
      Returns:
      a searcher that searches from values
      Mappings:
      Namespace Name Mixin selector
      official a Lflg;a(Ljava/util/List;Ljava/util/function/Function;)Lflg;
      intermediary method_43796 Lnet/minecraft/class_7454;method_43796(Ljava/util/List;Ljava/util/function/Function;)Lnet/minecraft/class_7454;
      named of Lnet/minecraft/client/search/TextSearcher;of(Ljava/util/List;Ljava/util/function/Function;)Lnet/minecraft/client/search/TextSearcher;
    • search

      List<T> search(String text)
      Returns the results of searching with the provided text.
      Returns:
      the results of searching with the provided text
      Mappings:
      Namespace Name Mixin selector
      official search Lflg;search(Ljava/lang/String;)Ljava/util/List;
      intermediary search Lnet/minecraft/class_7454;search(Ljava/lang/String;)Ljava/util/List;
      named search Lnet/minecraft/client/search/TextSearcher;search(Ljava/lang/String;)Ljava/util/List;