From a7fe955e6f241f76480e5d67fe2313831f1a3daa Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 4 Dec 2015 12:19:04 +0100 Subject: [PATCH] Fixed Bug with the booklet crashing if a crafting recipe is turned off in the config --- .../booklet/page/PageCrafting.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java index 607e7c31a..75422bb72 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java @@ -49,15 +49,17 @@ public class PageCrafting extends BookletPage{ if(this.recipes != null){ ItemStack[] stacks = new ItemStack[this.recipes.length]; for(int i = 0; i < this.recipes.length; i++){ - ItemStack output = this.recipes[i].getRecipeOutput(); - if(output != null){ - if(!this.arePageStacksWildcard){ - stacks[i] = output; - } - else{ - ItemStack wildcardOutput = output.copy(); - wildcardOutput.setItemDamage(Util.WILDCARD); - stacks[i] = wildcardOutput; + if(this.recipes[i] != null){ + ItemStack output = this.recipes[i].getRecipeOutput(); + if(output != null){ + if(!this.arePageStacksWildcard){ + stacks[i] = output; + } + else{ + ItemStack wildcardOutput = output.copy(); + wildcardOutput.setItemDamage(Util.WILDCARD); + stacks[i] = wildcardOutput; + } } } }