fix an exception in the booklet with broken furnace recipes

This commit is contained in:
Ellpeck 2017-03-10 23:15:50 +01:00
parent 93ac064869
commit d7561ddb82

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;
@ -32,8 +33,11 @@ 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)){
return entry.getKey();
ItemStack stack = entry.getValue();
if(StackUtil.isValid(stack)){
if(stack.isItemEqual(output)){
return entry.getKey();
}
}
}
return null;