private void renderItem(EntityMecha mecha, ItemStack stack, int par3, boolean leftHand, float dT)
{
GL11.glPushMatrix();
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
Item item = stack.getItem();
//Render tools
if(item instanceof ItemMechaAddon)
{
GL11.glRotatef(-90F, 0F, 0F, 1F);
GL11.glTranslatef(0F, 0F, 0F);
ItemMechaAddon toolItem = (ItemMechaAddon)item;
MechaItemType toolType = toolItem.type;
bindTexture(FlansModResourceHandler.getTexture(toolType));
if(toolType.model != null)
{
toolType.model.render(mecha, dT);
GL11.glPushMatrix();
if((leftHand && mecha.leftMouseHeld) || (!leftHand && mecha.rightMouseHeld))
{
GL11.glRotatef(25F * (float)mecha.ticksExisted, 1F, 0F, 0F);
}
toolType.model.renderDrill(mecha, dT);
GL11.glPopMatrix();
toolType.model.renderSaw(mecha, dT, (leftHand && mecha.leftMouseHeld) || (!leftHand && mecha.rightMouseHeld));
}
}
else if(item instanceof ItemGun && ((ItemGun)item).type.model != null)
{
GunType gunType = ((ItemGun)item).type;
ModelGun model = gunType.model;
GL11.glRotatef(-90F, 0F, 0F, 1F);
texturemanager.bindTexture(FlansModResourceHandler.getTexture(gunType));
ClientProxy.gunRenderer.renderGun(stack, gunType, 1F / 16F, model, leftHand ? mecha.leftAnimations : mecha.rightAnimations, 0F);
}
else
{
IIcon icon = stack.getIconIndex();
if (icon == null)
{
GL11.glPopMatrix();
return;
}
texturemanager.bindTexture(texturemanager.getResourceLocation(stack.getItemSpriteNumber()));
Tessellator tessellator = Tessellator.instance;
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
float f4 = 0.0F;
float f5 = 0.3F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glTranslatef(-f4, -f5, 0.0F);
float f6 = 1.5F;
GL11.glScalef(f6, f6, f6);
GL11.glTranslatef(0.2F, 0.7F, 0.0F);
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-133.0F, 0.0F, 0.0F, 1.0F);
renderer.renderItemIn2D(tessellator, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
if (stack.hasEffect(par3))
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
texturemanager.bindTexture(RES_ITEM_GLINT);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float f7 = 0.76F;
GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
GL11.glMatrixMode(GL11.GL_TEXTURE);