Skip to content

Commit

Permalink
Fix arrows with minimal textures crashing. #1101
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 19, 2014
1 parent ea46704 commit dec1cb4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/tconstruct/items/tools/Arrow.java
Expand Up @@ -11,6 +11,7 @@
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.tools.BowstringMaterial;
import tconstruct.library.tools.CustomMaterial;
import tconstruct.library.tools.FletchingMaterial;
import tconstruct.library.tools.ToolCore;
import tconstruct.tools.TinkerTools;
Expand Down Expand Up @@ -47,8 +48,11 @@ public String getIconSuffix (int partType)
@Override
protected int getDefaultColor(int renderPass, int materialID) {
// fletchling uses custom material
if(renderPass == 2)
return TConstructRegistry.getCustomMaterial(materialID, FletchingMaterial.class).color;
if(renderPass == 2) {
CustomMaterial mat = TConstructRegistry.getCustomMaterial(materialID, FletchingMaterial.class);
if(mat != null)
return mat.color;
}

return super.getDefaultColor(renderPass, materialID);
}
Expand Down

0 comments on commit dec1cb4

Please sign in to comment.