Skip to content

Commit

Permalink
Fix bolt fletchling color
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 10, 2014
1 parent 8fe42be commit 4f9f63a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java
@@ -1,5 +1,9 @@
package tconstruct.weaponry.ammo;

import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.CustomMaterial;
import tconstruct.library.tools.FletchingMaterial;
import tconstruct.library.tools.FletchlingLeafMaterial;
import tconstruct.weaponry.TinkerWeaponry;
import tconstruct.library.tools.DualMaterialToolPart;
import tconstruct.library.weaponry.AmmoItem;
Expand Down Expand Up @@ -89,4 +93,18 @@ public void buildTool (int id, String name, List list)
list.add(tool);
}
}

@Override
protected int getDefaultColor(int renderPass, int materialID) {
if(renderPass != 2)
return super.getDefaultColor(renderPass, materialID);

CustomMaterial mat = TConstructRegistry.getCustomMaterial(materialID, FletchingMaterial.class);
if(mat == null)
TConstructRegistry.getCustomMaterial(materialID, FletchlingLeafMaterial.class);
if(mat == null)
return 0xffffff;

return mat.color;
}
}

0 comments on commit 4f9f63a

Please sign in to comment.