Skip to content

Commit

Permalink
Fix entities/weapons in hand not using the color modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Sep 22, 2014
1 parent 2dec0ad commit 8e0bfdd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/tconstruct/client/ToolCoreRenderer.java
Expand Up @@ -143,6 +143,17 @@ public void renderItem (ItemRenderType type, ItemStack item, Object... data)
}
GL11.glPushMatrix();

// color
int color = item.getItem().getColorFromItemStack(item, 0);
float a = (float)(color >> 24 & 0xff) / 255F;
float r = (float)(color >> 16 & 0xff) / 255F;
float g = (float)(color >> 8 & 0xff) / 255F;
float b = (float)(color & 0xff) / 255F;
// no invisible
if(a < 0.01f)
a = 1.0f;
GL11.glColor4f(r, g, b, a);

if (type == ItemRenderType.INVENTORY)
{
GL11.glDisable(GL11.GL_LIGHTING);
Expand Down

0 comments on commit 8e0bfdd

Please sign in to comment.