/* * Decompiled with CFR 0.152. */ package net.minecraft.client.searchtree; import java.util.List; import java.util.Locale; import java.util.function.Function; import java.util.stream.Stream; import net.minecraft.client.searchtree.SuffixArray; import net.minecraft.resources.Identifier; public interface IdentifierSearchTree { public static IdentifierSearchTree empty() { return new IdentifierSearchTree(){ @Override public List searchNamespace(String namespace) { return List.of(); } @Override public List searchPath(String path) { return List.of(); } }; } public static IdentifierSearchTree create(List elements, Function> idGetter) { if (elements.isEmpty()) { return IdentifierSearchTree.empty(); } final SuffixArray namespaceTree = new SuffixArray(); final SuffixArray pathTree = new SuffixArray(); for (Object element : elements) { idGetter.apply(element).forEach(elementId -> { namespaceTree.add(element, elementId.getNamespace().toLowerCase(Locale.ROOT)); pathTree.add(element, elementId.getPath().toLowerCase(Locale.ROOT)); }); } namespaceTree.generate(); pathTree.generate(); return new IdentifierSearchTree(){ @Override public List searchNamespace(String namespace) { return namespaceTree.search(namespace); } @Override public List searchPath(String path) { return pathTree.search(path); } }; } public List searchNamespace(String var1); public List searchPath(String var1); }