From e3bbafaad49d15c7459ec0b38dd4268b4fd7e5ef Mon Sep 17 00:00:00 2001 From: shedaniel Date: Wed, 9 Sep 2020 17:08:36 +0800 Subject: Get rid of mixins, turn EntryStack methods turn an ImmutableList instead of ArrayList Signed-off-by: shedaniel --- .../src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java') diff --git a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java index 4d78312ed..5dd8ade09 100644 --- a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java +++ b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java @@ -309,7 +309,7 @@ public class RecipeHelperImpl implements RecipeHelper { private void startSection(MutablePair sectionData, String section) { sectionData.setRight(section); RoughlyEnoughItemsCore.LOGGER.debug("Reloading Section: \"%s\"", section); - sectionData.getLeft().start(); + sectionData.getLeft().reset().start(); } private void endSection(MutablePair sectionData) { @@ -321,13 +321,13 @@ public class RecipeHelperImpl implements RecipeHelper { private void pluginSection(MutablePair sectionData, String sectionName, List list, Consumer consumer) { for (REIPluginV0 plugin : list) { + startSection(sectionData, sectionName + " for " + plugin.getPluginIdentifier().toString()); try { - startSection(sectionData, sectionName + " for " + plugin.getPluginIdentifier().toString()); consumer.accept(plugin); - endSection(sectionData); } catch (Throwable e) { RoughlyEnoughItemsCore.LOGGER.error(plugin.getPluginIdentifier().toString() + " plugin failed to " + sectionName + "!", e); } + endSection(sectionData); } } @@ -378,16 +378,16 @@ public class RecipeHelperImpl implements RecipeHelper { List reiPluginV0s = new ArrayList<>(); endSection(sectionData); for (REIPluginEntry plugin : plugins) { + startSection(sectionData, "pre-register for " + plugin.getPluginIdentifier().toString()); try { if (plugin instanceof REIPluginV0) { - startSection(sectionData, "pre-register for " + plugin.getPluginIdentifier().toString()); ((REIPluginV0) plugin).preRegister(); reiPluginV0s.add((REIPluginV0) plugin); - endSection(sectionData); } } catch (Throwable e) { RoughlyEnoughItemsCore.LOGGER.error(plugin.getPluginIdentifier().toString() + " plugin failed to pre register!", e); } + endSection(sectionData); } pluginSection(sectionData, "register-bounds", reiPluginV0s, plugin -> plugin.registerBounds(displayHelper)); pluginSection(sectionData, "register-entries", reiPluginV0s, plugin -> plugin.registerEntries(entryRegistry)); -- cgit