From 99d4e59c0d8d4acc5200f5b3b40a1b4f0b34157b Mon Sep 17 00:00:00 2001 From: shedaniel Date: Wed, 25 Dec 2019 21:54:18 +0800 Subject: Reset entries, fix #222 --- src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java | 5 +++++ src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/me') diff --git a/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java b/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java index 7fd4f8d1b..42913d71c 100644 --- a/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java +++ b/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 list = DefaultedList.of(); diff --git a/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java index e4dd792b5..8db27a8c7 100644 --- a/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java +++ b/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!"); -- cgit