diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-06-04 13:14:53 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-06-04 13:14:53 +0800 |
| commit | a1480e28813b4fc9f6d4f8ce252dd5a355c00855 (patch) | |
| tree | f741aece04eba01118f45318c676c1181f5e03c5 /src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java | |
| parent | 7689bdbb42ad10b2ad99e2bae55ddaceac15bca7 (diff) | |
| download | RoughlyEnoughItems-a1480e28813b4fc9f6d4f8ce252dd5a355c00855.tar.gz RoughlyEnoughItems-a1480e28813b4fc9f6d4f8ce252dd5a355c00855.tar.bz2 RoughlyEnoughItems-a1480e28813b4fc9f6d4f8ce252dd5a355c00855.zip | |
Should not crash now
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java | 11 |
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; } |
