From ed630aa03841750550c2a73e6ad58cb3d23492b1 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Tue, 7 Oct 2014 22:10:30 +0200 Subject: [PATCH] Do not add materials that don't have actual parts to the NEI ToolMaterial stuff. Only happens in special cases, like the String material from IguanaTweaks, that has no craftable toolparts. Should finally fix https://github.com/SlimeKnights/IguanaTweaksTConstruct/issues/17 --- .../plugins/nei/RecipeHandlerToolMaterials.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/tconstruct/plugins/nei/RecipeHandlerToolMaterials.java b/src/main/java/tconstruct/plugins/nei/RecipeHandlerToolMaterials.java index 51b6f0be..39166a32 100644 --- a/src/main/java/tconstruct/plugins/nei/RecipeHandlerToolMaterials.java +++ b/src/main/java/tconstruct/plugins/nei/RecipeHandlerToolMaterials.java @@ -176,7 +176,9 @@ public class RecipeHandlerToolMaterials extends RecipeHandlerBase } } } - this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, matID)); + + if(toolParts.size() > 0) + this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, matID)); } } else @@ -193,13 +195,17 @@ public class RecipeHandlerToolMaterials extends RecipeHandlerBase int materialID = ((IToolPart) ingred.getItem()).getMaterialID(ingred); if (materialID >= 0) { - this.arecipes.add(new CachedToolMaterialsRecipe(getSingleList(ingred), materialID)); + List toolParts = getSingleList(ingred); + if(toolParts.size() > 0) + this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, materialID)); } } else if (PatternBuilder.instance.getPartID(ingred) < Short.MAX_VALUE) { int materialID = PatternBuilder.instance.getPartID(ingred); - this.arecipes.add(new CachedToolMaterialsRecipe(getSingleList(ingred), materialID)); + List toolParts = getSingleList(ingred); + if(toolParts.size() > 0) + this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, materialID)); } else {