diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-11-06 13:34:57 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-11-06 13:35:38 +0800 |
| commit | 92264d510b0e4f66719c970b2dbf21b495cfded1 (patch) | |
| tree | 60fa27acdb2c753b10008a49e5b47f203cb00ba1 /runtime/src/main/java/me/shedaniel/rei/impl/common | |
| parent | 987ee5269a9bc61b9ab4d07ea0986629b1421964 (diff) | |
| download | RoughlyEnoughItems-92264d510b0e4f66719c970b2dbf21b495cfded1.tar.gz RoughlyEnoughItems-92264d510b0e4f66719c970b2dbf21b495cfded1.tar.bz2 RoughlyEnoughItems-92264d510b0e4f66719c970b2dbf21b495cfded1.zip | |
Fix #647
Diffstat (limited to 'runtime/src/main/java/me/shedaniel/rei/impl/common')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java index 272bd1944..1c6e9d67f 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java @@ -29,6 +29,7 @@ import com.google.common.collect.Lists; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.client.REIRuntime; import me.shedaniel.rei.api.client.config.ConfigObject; +import me.shedaniel.rei.api.client.config.entry.EntryStackProvider; import me.shedaniel.rei.api.client.overlay.ScreenOverlay; import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.EntryRegistry; @@ -119,6 +120,14 @@ public class EntryRegistryImpl implements EntryRegistry { @Override public void refilter() { + ConfigObject config = ConfigObject.getInstance(); + if (config.getFilteredStackProviders() != null) { + List<EntryStack<?>> normalizedFilteredStacks = CollectionUtils.map(config.getFilteredStackProviders(), EntryStackProvider::provide); + normalizedFilteredStacks.removeIf(EntryStack::isEmpty); + config.getFilteredStackProviders().clear(); + config.getFilteredStackProviders().addAll(CollectionUtils.map(normalizedFilteredStacks, EntryStackProvider::ofStack)); + } + Stopwatch stopwatch = Stopwatch.createStarted(); FilteringContextImpl context = new FilteringContextImpl(entries); |
