mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-20 20:22:17 +00:00
Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb4fd40a53 | ||
|
|
7823923231 | ||
|
|
9fc099f877 | ||
|
|
ca5c54e157 | ||
|
|
2e2bcfdbdf | ||
|
|
76b315caec | ||
|
|
685477b381 | ||
|
|
28d653a3b5 | ||
|
|
34734a622b | ||
|
|
331a9fd638 | ||
|
|
98c49caff9 | ||
|
|
622b696389 | ||
|
|
985e1e0425 | ||
|
|
da05482ef0 | ||
|
|
b41c570315 | ||
|
|
0373e7376b | ||
|
|
178021a8e8 | ||
|
|
8dd9014109 |
@@ -65,17 +65,12 @@ public class SearchTokenParser {
|
||||
|
||||
private static class ProvidersCache {
|
||||
|
||||
public String languageCode = null;
|
||||
public List<ISearchParserProvider> providers = new ArrayList<>();
|
||||
|
||||
public void clear() {
|
||||
this.languageCode = null;
|
||||
this.providers.clear();
|
||||
}
|
||||
protected String languageCode = null;
|
||||
protected List<ISearchParserProvider> providers;
|
||||
}
|
||||
|
||||
protected final List<ISearchParserProvider> searchProviders;
|
||||
protected final ProvidersCache providersCache = new ProvidersCache();
|
||||
protected ProvidersCache providersCache = new ProvidersCache();
|
||||
|
||||
public SearchTokenParser(List<ISearchParserProvider> searchProviders) {
|
||||
this.searchProviders = searchProviders;
|
||||
@@ -87,7 +82,6 @@ public class SearchTokenParser {
|
||||
|
||||
public void addProvider(ISearchParserProvider provider) {
|
||||
this.searchProviders.add(provider);
|
||||
this.providersCache.clear();
|
||||
}
|
||||
|
||||
protected List<ISearchParserProvider> getProviders() {
|
||||
@@ -99,7 +93,7 @@ public class SearchTokenParser {
|
||||
for (int index = this.searchProviders.size() - 1; index >= 0; index--) {
|
||||
ISearchParserProvider provider = this.searchProviders.get(index);
|
||||
|
||||
if (!providers.containsKey(provider.getPrefix())
|
||||
if (!providers.containsKey(provider.getPrefix()) && provider.getSearchMode() != SearchMode.NEVER
|
||||
&& provider.getMatchingLanguages().contains(currentLanguage)) {
|
||||
providers.put(provider.getPrefix(), provider);
|
||||
}
|
||||
@@ -113,9 +107,7 @@ public class SearchTokenParser {
|
||||
}
|
||||
|
||||
public ISearchParserProvider getProvider(char ch) {
|
||||
return getProviders().stream()
|
||||
.filter(provider -> provider.getSearchMode() == SearchMode.PREFIX && provider.getPrefix() == ch)
|
||||
.findFirst().orElse(null);
|
||||
return getProviders().stream().filter(provider -> provider.getPrefix() == ch).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public ItemFilter getFilter(String filterText) {
|
||||
|
||||
Reference in new issue
Block a user