aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-05-01 13:22:23 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-05-01 13:22:23 +0800
commitc1de02e7d2d42123cb207f9fa8e869c8a25fcdf6 (patch)
tree8dd9f6ea157ae0bf85561e7f85b085b9565141de /src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
parent6345d24492242ba9ea26c6b83163aa81464c8cfd (diff)
parentc57ef35f9d99ec64ec1501932a70cab40fcc5107 (diff)
downloadRoughlyEnoughItems-c1de02e7d2d42123cb207f9fa8e869c8a25fcdf6.tar.gz
RoughlyEnoughItems-c1de02e7d2d42123cb207f9fa8e869c8a25fcdf6.tar.bz2
RoughlyEnoughItems-c1de02e7d2d42123cb207f9fa8e869c8a25fcdf6.zip
Merge branch '1.14-dev' into 1.14
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() {