aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java/me/shedaniel/rei/impl/common
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-10-30 16:38:00 +0800
committershedaniel <daniel@shedaniel.me>2022-11-05 19:31:46 +0800
commitfd9006d64edbf3d1eaffa8e607f4dd167eae721e (patch)
tree0353776c0e7a7b6e6e97ae7188c7b8ac72f2ea7d /runtime/src/main/java/me/shedaniel/rei/impl/common
parent8d1c2c2e5e6e513715101f5eabc39dff8fb4a35c (diff)
downloadRoughlyEnoughItems-fd9006d64edbf3d1eaffa8e607f4dd167eae721e.tar.gz
RoughlyEnoughItems-fd9006d64edbf3d1eaffa8e607f4dd167eae721e.tar.bz2
RoughlyEnoughItems-fd9006d64edbf3d1eaffa8e607f4dd167eae721e.zip
Improve Async Search
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.java6
1 files changed, 5 insertions, 1 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 293f3bc3e..af9f4ddb3 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
@@ -204,7 +204,11 @@ public class EntryRegistryImpl implements EntryRegistry {
if (afterEntry != null) {
int index = registryList.lastIndexOf(afterEntry);
- registryList.addAll(index, filtered, hashes);
+ if (index != -1) {
+ registryList.addAll(index, filtered, hashes);
+ } else {
+ registryList.addAll(filtered, hashes);
+ }
} else registryList.addAll(filtered, hashes);
for (EntryRegistryListener listener : listeners) {