/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.google.common.collect.ImmutableList */ package net.minecraft.client.searchtree; import com.google.common.collect.ImmutableList; import java.util.List; import java.util.function.Function; import java.util.stream.Stream; import net.minecraft.client.searchtree.IdSearchTree; import net.minecraft.client.searchtree.IntersectionIterator; import net.minecraft.client.searchtree.MergingUniqueIterator; import net.minecraft.client.searchtree.SearchTree; import net.minecraft.resources.Identifier; public class FullTextSearchTree extends IdSearchTree { private final SearchTree plainTextSearchTree; public FullTextSearchTree(Function> nameGetter, Function> idGetter, List contents) { super(idGetter, contents); this.plainTextSearchTree = SearchTree.plainText(contents, nameGetter); } @Override protected List searchPlainText(String text) { return this.plainTextSearchTree.search(text); } @Override protected List searchIdentifier(String namespace, String path) { List namespaces = this.identifierSearchTree.searchNamespace(namespace); List paths = this.identifierSearchTree.searchPath(path); List names = this.plainTextSearchTree.search(path); MergingUniqueIterator mergedPathsAndNames = new MergingUniqueIterator(paths.iterator(), names.iterator(), this.additionOrder); return ImmutableList.copyOf(new IntersectionIterator(namespaces.iterator(), mergedPathsAndNames, this.additionOrder)); } }