Fix an exception due to broken furnace recipes in the booklet

Closes #631
This commit is contained in:
Ellpeck 2017-02-13 14:16:57 +01:00
parent e153fc872e
commit e2dfaab2a7

View file

@ -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;
@ -36,10 +37,13 @@ public class PageFurnace extends BookletPage{
private static ItemStack getInputForOutput(ItemStack output){
for(Map.Entry<ItemStack, ItemStack> entry : FurnaceRecipes.instance().getSmeltingList().entrySet()){
if(entry.getValue().isItemEqual(output)){
ItemStack stack = entry.getValue();
if(StackUtil.isValid(stack)){
if(stack.isItemEqual(output)){
return entry.getKey();
}
}
}
return null;
}