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
This commit is contained in:
Bernhard Bonigl committed 2014-10-07 22:10:30 +02:00
1 parent 2c2b9ba281
commit ed630aa038
1 file changed
+9 -3
@@ -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
{