Prevent crash with invalid material toolparts. #1124

This commit is contained in:
Bernhard Bonigl committed 2014-10-26 16:36:14 +01:00
1 parent 5905653f80
commit 71b0f65d63
1 file changed
+1 -1
@@ -155,7 +155,7 @@ public class DynamicToolPart extends CraftingItem implements IToolPart
if(matId > icons.length)
return super.getColorFromItemStack(stack, renderpass);
if(icons[matId] == null)
if(matId >= 0 && icons[matId] == null)
return TConstructRegistry.getMaterial(matId).primaryColor();
return super.getColorFromItemStack(stack, renderpass);