Browse Source

Reset entries, fix #222

shedaniel 5 years ago
parent
commit
88b64ddc35

+ 1 - 1
gradle.properties

@@ -1,4 +1,4 @@
-mod_version=3.2.30
+mod_version=3.2.31
 minecraft_version=1.15
 yarn_version=1.15+build.1
 fabricloader_version=0.7.2+build.174

+ 5 - 0
src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java

@@ -52,6 +52,11 @@ public class EntryRegistryImpl implements EntryRegistry {
         return entries;
     }
 
+    public void reset() {
+        entries.clear();
+        entrySet.clear();
+    }
+
     @Override
     public ItemStack[] getAllStacksFromItem(Item item) {
         DefaultedList<ItemStack> list = DefaultedList.of();

+ 1 - 1
src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java

@@ -269,7 +269,7 @@ public class RecipeHelperImpl implements RecipeHelper {
         plugins.sort(Comparator.comparingInt(REIPluginEntry::getPriority).reversed());
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Loading %d plugins: %s", plugins.size(), plugins.stream().map(REIPluginEntry::getPluginIdentifier).map(Identifier::toString).collect(Collectors.joining(", ")));
         Collections.reverse(plugins);
-        EntryRegistry.getInstance().getStacksList().clear();
+        ((EntryRegistryImpl) EntryRegistry.getInstance()).reset();
         Version reiVersion = FabricLoader.getInstance().getModContainer("roughlyenoughitems").get().getMetadata().getVersion();
         if (!(reiVersion instanceof SemanticVersion))
             RoughlyEnoughItemsCore.LOGGER.warn("[REI] Roughly Enough Items is not using semantic versioning, will be ignoring plugins' minimum versions!");