Added Feature: #0690 - Texture for Colour Applicator

This commit is contained in:
AlgorithmX2 2014-07-31 20:45:25 -05:00
parent b1357bc5e2
commit f0320fef76
2 changed files with 41 additions and 37 deletions

View file

@ -76,11 +76,13 @@ public class ToolColorApplicatorRender implements IItemRenderer
GL11.glRotatef( 180F, 1.0F, 0.0F, 0.0F ); GL11.glRotatef( 180F, 1.0F, 0.0F, 0.0F );
} }
float u = ExtraItemTextures.White.getIcon().getInterpolatedU( 8.1 ); IIcon dark = ExtraItemTextures.ToolColorApplicatorTip_Dark.getIcon();
float v = ExtraItemTextures.White.getIcon().getInterpolatedV( 8.1 ); IIcon med = ExtraItemTextures.ToolColorApplicatorTip_Medium.getIcon();
IIcon light = ExtraItemTextures.ToolColorApplicatorTip_Light.getIcon();
GL11.glScalef( 1F / 16F, 1F / 16F, 1F ); GL11.glScalef( 1F / 16F, 1F / 16F, 1F );
GL11.glTranslatef( 4, 6, 0 ); if ( type != ItemRenderType.INVENTORY )
GL11.glTranslatef( 2, 0, 0 );
GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_LIGHTING );
AEColor col = null; AEColor col = null;
@ -90,44 +92,40 @@ public class ToolColorApplicatorRender implements IItemRenderer
if ( col != null ) if ( col != null )
{ {
tessellator.startDrawingQuads(); tessellator.startDrawingQuads();
float z = 0;
for (int g = 0; g < 7; g++)// 8 f4 = ((IIcon) dark).getMinU();
{ f5 = ((IIcon) dark).getMaxU();
int x = g - 3 * direction; f6 = ((IIcon) dark).getMinV();
int y = g + 3 * direction; f7 = ((IIcon) dark).getMaxV();
if ( type != ItemRenderType.INVENTORY ) tessellator.setColorOpaque_I( col.blackVariant );
{ tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 );
x += 2; tessellator.addVertexWithUV( 16, 0, 0, (double) f5, (double) f7 );
} tessellator.addVertexWithUV( 16, 16, 0, (double) f5, (double) f6 );
tessellator.addVertexWithUV( 0, 16, 0, (double) f4, (double) f6 );
if ( g < 6 ) f4 = ((IIcon) light).getMinU();
{ f5 = ((IIcon) light).getMaxU();
tessellator.setColorOpaque_I( col.whiteVariant ); f6 = ((IIcon) light).getMinV();
tessellator.addVertexWithUV( x, y, z, (double) u, (double) v ); f7 = ((IIcon) light).getMaxV();
tessellator.addVertexWithUV( x + 1, y, z, (double) u, (double) v );
tessellator.addVertexWithUV( x + 1, y + 1, z, (double) u, (double) v );
tessellator.addVertexWithUV( x, y + 1, z, (double) u, (double) v );
}
y -= direction; tessellator.setColorOpaque_I( col.whiteVariant );
tessellator.setColorOpaque_I( col.mediumVariant ); tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 );
tessellator.addVertexWithUV( x, y, z, (double) u, (double) v ); tessellator.addVertexWithUV( 16, 0, 0, (double) f5, (double) f7 );
tessellator.addVertexWithUV( x + 1, y, z, (double) u, (double) v ); tessellator.addVertexWithUV( 16, 16, 0, (double) f5, (double) f6 );
tessellator.addVertexWithUV( x + 1, y + 1, z, (double) u, (double) v ); tessellator.addVertexWithUV( 0, 16, 0, (double) f4, (double) f6 );
tessellator.addVertexWithUV( x, y + 1, z, (double) u, (double) v );
f4 = ((IIcon) med).getMinU();
f5 = ((IIcon) med).getMaxU();
f6 = ((IIcon) med).getMinV();
f7 = ((IIcon) med).getMaxV();
tessellator.setColorOpaque_I( col.mediumVariant );
tessellator.addVertexWithUV( 0, 0, 0, (double) f4, (double) f7 );
tessellator.addVertexWithUV( 16, 0, 0, (double) f5, (double) f7 );
tessellator.addVertexWithUV( 16, 16, 0, (double) f5, (double) f6 );
tessellator.addVertexWithUV( 0, 16, 0, (double) f4, (double) f6 );
x += direction;
if ( g < 6 )
{
tessellator.setColorOpaque_I( col.blackVariant );
tessellator.addVertexWithUV( x, y, z, (double) u, (double) v );
tessellator.addVertexWithUV( x + 1, y, z, (double) u, (double) v );
tessellator.addVertexWithUV( x + 1, y + 1, z, (double) u, (double) v );
tessellator.addVertexWithUV( x, y + 1, z, (double) u, (double) v );
}
}
tessellator.draw(); tessellator.draw();
} }

View file

@ -9,7 +9,13 @@ import cpw.mods.fml.relauncher.SideOnly;
public enum ExtraItemTextures public enum ExtraItemTextures
{ {
White("White"), ItemPaintBallShimmer("ItemPaintBallShimmer"); White("White"), ItemPaintBallShimmer("ItemPaintBallShimmer"),
ToolColorApplicatorTip_Medium("ToolColorApplicatorTip_Medium"),
ToolColorApplicatorTip_Dark("ToolColorApplicatorTip_Dark"),
ToolColorApplicatorTip_Light("ToolColorApplicatorTip_Light");
final private String name; final private String name;
public IIcon IIcon; public IIcon IIcon;