From d7561ddb82cfa48d8eb856c97b63bc978ebc3856 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 10 Mar 2017 23:15:50 +0100 Subject: [PATCH] fix an exception in the booklet with broken furnace recipes --- .../actuallyadditions/mod/booklet/page/PageFurnace.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java index ce37f479d..3f9e887c4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java @@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.booklet.page; import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase; import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet; +import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.fml.client.config.GuiUtils; @@ -32,8 +33,11 @@ public class PageFurnace extends BookletPage{ private static ItemStack getInputForOutput(ItemStack output){ for(Map.Entry entry : FurnaceRecipes.instance().getSmeltingList().entrySet()){ - if(entry.getValue().isItemEqual(output)){ - return entry.getKey(); + ItemStack stack = entry.getValue(); + if(StackUtil.isValid(stack)){ + if(stack.isItemEqual(output)){ + return entry.getKey(); + } } } return null;