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.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
index ec922d4c8..9c4b21ed5 100644
--- a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
@@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.recipe.Recipe;
import net.minecraft.recipe.RecipeManager;
import net.minecraft.util.Identifier;
+import org.apache.logging.log4j.Level;
import java.awt.*;
import java.util.List;
@@ -300,9 +301,13 @@ public class RecipeHelperImpl implements RecipeHelper {
RecipeCategory category = getCategory(display.getRecipeCategory());
List<DisplayVisibilityHandler> list = getDisplayVisibilityHandlers().stream().sorted(VISIBILITY_HANDLER_COMPARATOR).collect(Collectors.toList());
for(DisplayVisibilityHandler displayVisibilityHandler : list) {
- DisplayVisibility visibility = displayVisibilityHandler.handleDisplay(category, display);
- if (visibility != DisplayVisibility.PASS)
- return visibility == DisplayVisibility.ALWAYS_VISIBLE || visibility == DisplayVisibility.CONFIG_OPTIONAL;
+ try {
+ DisplayVisibility visibility = displayVisibilityHandler.handleDisplay(category, display);
+ if (visibility != DisplayVisibility.PASS)
+ return visibility == DisplayVisibility.ALWAYS_VISIBLE || visibility == DisplayVisibility.CONFIG_OPTIONAL;
+ } catch (Throwable throwable) {
+ RoughlyEnoughItemsCore.LOGGER.error("[REI] Failed to check if the recipe is visible!", throwable);
+ }
}
return true;
}