Skip to content

Commit

Permalink
Prevent fiery NPEs with minimal texture bows when natura/tc is not pr…
Browse files Browse the repository at this point in the history
…esent #1055
  • Loading branch information
bonii-xx committed Oct 6, 2014
1 parent bd498aa commit 5933333
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/tconstruct/items/tools/Shortbow.java
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.world.World;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.BowstringMaterial;
import tconstruct.library.tools.CustomMaterial;
import tconstruct.tools.TinkerTools;

public class Shortbow extends BowBase
Expand Down Expand Up @@ -43,8 +44,11 @@ public String getIconSuffix (int partType)
@Override
protected int getDefaultColor(int renderPass, int materialID) {
// bowstring uses custom material
if(renderPass == 0)
return TConstructRegistry.getCustomMaterial(materialID, BowstringMaterial.class).color;
if(renderPass == 0) {
CustomMaterial mat = TConstructRegistry.getCustomMaterial(materialID, BowstringMaterial.class);
if(mat != null)
return mat.color;
}

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

0 comments on commit 5933333

Please sign in to comment.