aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java')
-rw-r--r--src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
index 22df089ea..ec5b211d0 100644
--- a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
@@ -185,6 +185,9 @@ public class RecipeHelperImpl implements RecipeHelper {
this.categoryDisplaySettingsMap.clear();
this.displayVisibilityHandlers.clear();
((DisplayHelperImpl) RoughlyEnoughItemsCore.getDisplayHelper()).resetCache();
+ BaseBoundsHandler baseBoundsHandler = new BaseBoundsHandlerImpl();
+ RoughlyEnoughItemsCore.getDisplayHelper().registerBoundsHandler(baseBoundsHandler);
+ ((DisplayHelperImpl) RoughlyEnoughItemsCore.getDisplayHelper()).setBaseBoundsHandler(baseBoundsHandler);
long startTime = System.currentTimeMillis();
List<REIPluginEntry> plugins = new LinkedList<>(RoughlyEnoughItemsCore.getPlugins());
plugins.sort((first, second) -> {
@@ -196,16 +199,20 @@ public class RecipeHelperImpl implements RecipeHelper {
PluginDisabler pluginDisabler = RoughlyEnoughItemsCore.getPluginDisabler();
plugins.forEach(plugin -> {
Identifier identifier = plugin.getPluginIdentifier();
- if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_ITEMS))
- plugin.registerItems(RoughlyEnoughItemsCore.getItemRegisterer());
- if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_CATEGORIES))
- plugin.registerPluginCategories(this);
- if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_RECIPE_DISPLAYS))
- plugin.registerRecipeDisplays(this);
- if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_BOUNDS))
- plugin.registerBounds(RoughlyEnoughItemsCore.getDisplayHelper());
- if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_OTHERS))
- plugin.registerOthers(this);
+ try {
+ if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_ITEMS))
+ plugin.registerItems(RoughlyEnoughItemsCore.getItemRegisterer());
+ if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_CATEGORIES))
+ plugin.registerPluginCategories(this);
+ if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_RECIPE_DISPLAYS))
+ plugin.registerRecipeDisplays(this);
+ if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_BOUNDS))
+ plugin.registerBounds(RoughlyEnoughItemsCore.getDisplayHelper());
+ if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_OTHERS))
+ plugin.registerOthers(this);
+ } catch (Exception e) {
+ RoughlyEnoughItemsCore.LOGGER.error("[REI] %s plugin failed to load: %s", identifier.toString(), e.getLocalizedMessage());
+ }
});
if (getDisplayVisibilityHandlers().size() == 0)
registerRecipeVisibilityHandler(new DisplayVisibilityHandler() {