List of usage examples for org.lwjgl.opengl GL11 glScalef
public static native void glScalef(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z);
From source file:de.sanandrew.core.manpack.mod.client.UpdateOverlayManager.java
License:Creative Commons License
public void renderInfobox() { if (this.mc == null || this.fontRenderer == null) { this.mc = Minecraft.getMinecraft(); this.fontRenderer = new FontRenderer(this.mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.mc.renderEngine, true); this.timer.elapsedTicks = -1; }// www . java2s .co m if (this.counter == 0 && this.scale <= 0.00F) { return; } this.fontRenderer.setBidiFlag(this.mc.fontRenderer.getBidiFlag()); String update = this.updateMods.get(this.currMod).getValue0().getModName() + " update out!"; String version = "new version: " + this.updateMods.get(this.currMod).getValue1(); String details = "press \247f[" + Keyboard.getKeyName(ClientProxy.KEY_UPDATE_GUI.getKeyCode()) + "]\247r for details"; this.mc.renderEngine.bindTexture(this.frameTex); int width = Math.max(this.fontRenderer.getStringWidth(update), Math.max(this.fontRenderer.getStringWidth(version), this.fontRenderer.getStringWidth(details))) + 12; int height = 45; GL11.glPushMatrix(); GL11.glScalef(this.scale, this.scale, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPushMatrix(); GL11.glScalef(1.0F / 256.0F * 16, 1.0F / 256.0F * 16, 1.0F); this.drawTexturedModalRect(0, 0, 0, 0, width * 16, 4 * 16); this.drawTexturedModalRect(0, 4 * 16, 0, 4 * 16, 4 * 16, (height - 8) * 16); this.drawTexturedModalRect(0, (height - 4) * 16, 0, (height - 4) * 16, width * 16, 4 * 16); this.drawTexturedModalRect((width - 4) * 16, 4 * 16, 0, 4 * 16, 4 * 16, (height - 8) * 16); GL11.glPopMatrix(); drawRect(1, 1, width - 1, height - 1, 0x80000000); GL11.glPopMatrix(); if (this.scale >= 1.00F && this.counter > 0) { if (!this.mc.isGamePaused()) { this.timer.updateTimer(); } int alpha = ((int) (Math.abs(this.txtFade) * 255.0F) & 255) << 24; GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if (alpha != 0) { this.drawCenteredString(this.fontRenderer, update, width / 2, 5, 0xFFFF00 | alpha); this.drawCenteredString(this.fontRenderer, version, width / 2, 12, 0xA0A0A0 | alpha); } GL11.glDisable(GL11.GL_BLEND); this.drawCenteredString(this.fontRenderer, details, width / 2, 30, 0xA0A0A0); this.drawCenteredString(this.fontRenderer, Integer.toString(this.counter), width / 2, height - 4, 0xFFFFFF); } else if (this.counter > 0) { this.scale += 0.1F; } else if (this.scale > 0.00F) { this.scale -= 0.1F; } if (Math.abs(this.txtFade) < 0.01F) { this.currMod++; this.txtFade -= 0.1F; } else if (Math.abs(this.txtFade) < 1.00F) { this.txtFade -= 0.1F; } else if (this.txtFade <= -1.00F) { this.txtFade = 1.00F; } if (this.timer.elapsedTicks > 0 && this.counter > 0) { this.counter--; if (this.counter > 0 && this.counter % 5 == 0) { this.txtFade -= 0.1F; } this.timer.elapsedTicks = 0; } }
From source file:de.sanandrew.core.manpack.util.client.helpers.ItemRenderHelper.java
License:Creative Commons License
/** * Renders an IIcon instance in 3D./* w w w . j ava 2s. c o m*/ * * @param icon the icon to be rendered * @param isBlock if it should be rendered as a block or not * @param hasAlpha if it has a transparent texture * @param color the tint it should be rendered in */ public static void renderIconIn3D(IIcon icon, boolean isBlock, boolean hasAlpha, int color) { GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); if (isBlock) { Minecraft.getMinecraft().renderEngine .bindTexture(Minecraft.getMinecraft().renderEngine.getResourceLocation(0)); if (hasAlpha) { GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); } GL11.glTranslatef(0.5F, 0.5F, 0.0F); GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glPushMatrix(); Tessellator tessellator = Tessellator.instance; float red = (color >> 16 & 255) / 255.0F; float green = (color >> 8 & 255) / 255.0F; float blue = (color & 255) / 255.0F; GL11.glColor4f(red, green, blue, 1.0F); Blocks.stone.setBlockBoundsForItemRender(); renderBlocksRi.setRenderBoundsFromBlock(Blocks.stone); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderBlocksRi.renderFaceYNeg(Blocks.stone, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderBlocksRi.renderFaceYPos(Blocks.stone, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderBlocksRi.renderFaceZNeg(Blocks.stone, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderBlocksRi.renderFaceZPos(Blocks.stone, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderBlocksRi.renderFaceXNeg(Blocks.stone, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderBlocksRi.renderFaceXPos(Blocks.stone, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); GL11.glPopMatrix(); if (hasAlpha) { GL11.glDisable(GL11.GL_BLEND); } } else { if (hasAlpha) { GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); } float red = (color >> 16 & 255) / 255.0F; float green = (color >> 8 & 255) / 255.0F; float blue = (color & 255) / 255.0F; GL11.glColor4f(red, green, blue, 1.0F); renderItemIn3D(icon, false, 1); if (hasAlpha) { GL11.glDisable(GL11.GL_BLEND); } } GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); TextureUtil.func_147945_b(); }
From source file:de.sanandrew.core.manpack.util.client.helpers.ItemRenderHelper.java
License:Creative Commons License
/** * Renders an ItemStack in 3D.// w w w.j av a2 s . c o m * * @param stack the ItemStack to be rendered */ public static void renderItemIn3D(ItemStack stack) { if (stack.getItem() != null) { GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(stack, ItemRenderType.EQUIPPED); if (customRenderer != null) { Minecraft.getMinecraft().renderEngine.bindTexture( Minecraft.getMinecraft().renderEngine.getResourceLocation(stack.getItemSpriteNumber())); GL11.glPushMatrix(); GL11.glTranslatef(0.5F, 0.5F, 0.0F); float blockScale = 0.5F; GL11.glScalef(blockScale, blockScale, blockScale); ForgeHooksClient.renderEquippedItem(ItemRenderType.EQUIPPED, customRenderer, renderBlocksRi, Minecraft.getMinecraft().player, stack); GL11.glPopMatrix(); } else if (stack.getItemSpriteNumber() == 0 && stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) { Minecraft.getMinecraft().renderEngine.bindTexture( Minecraft.getMinecraft().renderEngine.getResourceLocation(stack.getItemSpriteNumber())); Block block = Block.getBlockFromItem(stack.getItem()); float blockScale = 0.5F; int renderType = block.getRenderType(); if (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2) { blockScale = 1.0F; } if (block.getRenderBlockPass() > 0) { GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); } GL11.glTranslatef(0.5F, 0.5F, 0.0F); GL11.glScalef(blockScale, blockScale, blockScale); GL11.glPushMatrix(); renderBlocksRi.renderBlockAsItem(block, stack.getItemDamage(), 1.0F); GL11.glPopMatrix(); if (block.getRenderBlockPass() > 0) { GL11.glDisable(GL11.GL_BLEND); } } else { if (stack.getItem().requiresMultipleRenderPasses()) { for (int j = 0; j < stack.getItem().getRenderPasses(stack.getItemDamage()); j++) { IIcon icon = stack.getItem().getIcon(stack, j); int color = stack.getItem().getColorFromItemStack(stack, j); float red = (color >> 16 & 255) / 255.0F; float green = (color >> 8 & 255) / 255.0F; float blue = (color & 255) / 255.0F; GL11.glColor4f(red, green, blue, 1.0F); renderItemIn3D(icon, stack.hasEffect(j), 1); } } else { IIcon icon = stack.getItem().getIcon(stack, 0); if (stack.getItem() instanceof ItemCloth) { GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); } int color = stack.getItem().getColorFromItemStack(stack, 0); float red = (color >> 16 & 255) / 255.0F; float green = (color >> 8 & 255) / 255.0F; float blue = (color & 255) / 255.0F; GL11.glColor4f(red, green, blue, 1.0F); renderItemIn3D(icon, stack.hasEffect(0), 1); if (stack.getItem() instanceof ItemCloth) { GL11.glDisable(GL11.GL_BLEND); } } } GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); TextureUtil.func_147945_b(); } }
From source file:de.sanandrew.core.manpack.util.client.helpers.ItemRenderHelper.java
License:Creative Commons License
private static void renderItemIn3D(IIcon icon, boolean withEffect, int spriteIndex) { GL11.glPushMatrix();//from w w w . j ava2 s . c o m if (icon == null) { GL11.glPopMatrix(); return; } float minU = icon.getMinU(); float maxU = icon.getMaxU(); float minV = icon.getMinV(); float maxV = icon.getMaxV(); Tessellator tessellator = Tessellator.instance; Minecraft.getMinecraft().renderEngine .bindTexture(Minecraft.getMinecraft().renderEngine.getResourceLocation(spriteIndex)); GL11.glEnable(GL12.GL_RESCALE_NORMAL); renderItemIn2D(tessellator, maxU, minV, minU, maxV, icon.getIconWidth(), icon.getIconHeight(), 0.0625F, false); if (withEffect) { float baseClr = 0.76F; float glintScale = 0.125F; float glintTransX = Minecraft.getSystemTime() % 3000L / 3000.0F * 8.0F; GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); Minecraft.getMinecraft().renderEngine.bindTexture(GLINT_PNG); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); GL11.glColor4f(0.5F * baseClr, 0.25F * baseClr, 0.8F * baseClr, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glPushMatrix(); GL11.glScalef(glintScale, glintScale, glintScale); GL11.glTranslatef(glintTransX, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, false); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(glintScale, glintScale, glintScale); glintTransX = Minecraft.getSystemTime() % 4873L / 4873.0F * 8.0F; GL11.glTranslatef(-glintTransX, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, false); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); } GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); }
From source file:de.sanandrew.core.manpack.util.client.helpers.ItemRenderHelper.java
License:Creative Commons License
/** * Renders an IIcon in 2D.//from w ww. j av a2 s . c om * * @param icon the icon to be rendered * @param spriteIndex the index of the texture to be used (0 = blocks, 1 = items) * @param hasEffect if it has an enchantment effect * @param isGlowing if it should glow in the dark */ public static void renderIcon(IIcon icon, int spriteIndex, boolean hasEffect, boolean isGlowing) { GL11.glPushMatrix(); if (icon == null) { GL11.glPopMatrix(); return; } float minU = icon.getMinU(); float maxU = icon.getMaxU(); float minV = icon.getMinV(); float maxV = icon.getMaxV(); float transX = 0.0F; float transY = 0.3F; float scale = 1.5F; Tessellator tessellator = Tessellator.instance; Minecraft.getMinecraft().renderEngine .bindTexture(Minecraft.getMinecraft().renderEngine.getResourceLocation(spriteIndex)); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glTranslatef(-transX, -transY, 0.0F); GL11.glScalef(scale, scale, scale); GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); renderItemIn2D(tessellator, maxU, minV, minU, maxV, icon.getIconWidth(), icon.getIconHeight(), 0.0625F, isGlowing); if (hasEffect) { float baseClr = 0.76F; float glintScale = 0.125F; float glintTransX = Minecraft.getSystemTime() % 3000L / 3000.0F * 8.0F; GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); Minecraft.getMinecraft().renderEngine.bindTexture(GLINT_PNG); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); GL11.glColor4f(0.5F * baseClr, 0.25F * baseClr, 0.8F * baseClr, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glPushMatrix(); GL11.glScalef(glintScale, glintScale, glintScale); GL11.glTranslatef(glintTransX, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, false); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(glintScale, glintScale, glintScale); glintTransX = Minecraft.getSystemTime() % 4873L / 4873.0F * 8.0F; GL11.glTranslatef(-glintTransX, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, false); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); } GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); }
From source file:de.sanandrew.mods.betterboat.client.RenderBetterBoat.java
License:Creative Commons License
public void doRender(EntityBetterBoat boat, double x, double y, double z, float yaw, float partTicks) { GL11.glPushMatrix();/*from w w w . java 2s.c om*/ GL11.glTranslatef((float) x, (float) y, (float) z); GL11.glRotatef(180.0F - yaw, 0.0F, 1.0F, 0.0F); float timeSinceHit = (float) boat.getTimeSinceHit() - partTicks; float damageTaken = boat.getDamageTaken() - partTicks; if (damageTaken < 0.0F) { damageTaken = 0.0F; } if (timeSinceHit > 0.0F) { GL11.glRotatef(MathHelper.sin(timeSinceHit) * timeSinceHit * damageTaken / 10.0F * (float) boat.getForwardDirection(), 1.0F, 0.0F, 0.0F); } float scale = 0.75F; GL11.glScalef(scale, scale, scale); GL11.glScalef(1.0F / scale, 1.0F / scale, 1.0F / scale); this.bindEntityTexture(boat); GL11.glScalef(-1.0F, -1.0F, 1.0F); this.modelBoat.render(boat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
From source file:de.sanandrew.mods.claysoldiers.client.event.RenderStatDisplayOverlay.java
License:Creative Commons License
private void renderStats(Minecraft mc, String title, List<Quartet<Integer, String, Integer, ItemStack>> teams, int xPos, int yPos) { this.drawGradientRect(xPos, yPos, xPos + 100, yPos + 13, 0x00000000, 0x80FFFFFF); this.p_titleRenderer.drawString(title, xPos + 50 - this.p_titleRenderer.getStringWidth(title) / 2 - 1, yPos + 1, 0x000000);//from ww w.j a v a2 s . c om this.p_titleRenderer.drawString(title, xPos + 50 - this.p_titleRenderer.getStringWidth(title) / 2, yPos + 2, 0x000000); this.p_titleRenderer.drawString(title, xPos + 50 - this.p_titleRenderer.getStringWidth(title) / 2 + 1, yPos + 1, 0x000000); this.p_titleRenderer.drawString(title, xPos + 50 - this.p_titleRenderer.getStringWidth(title) / 2, yPos, 0x000000); this.p_titleRenderer.drawString(title, xPos + 50 - this.p_titleRenderer.getStringWidth(title) / 2, yPos + 1, 0xFFFFFF); this.drawGradientRect(xPos - 1, yPos - 1, xPos, yPos + 13, 0x00000000, 0xC0000000); this.drawGradientRect(xPos + 100, yPos - 1, xPos + 101, yPos + 13, 0x00000000, 0xC0000000); int pos = 0; for (Quartet<Integer, String, Integer, ItemStack> team : teams) { String text = SAPUtils.translate(team.getValue1()) + ": " + team.getValue2().toString(); drawRect(xPos, yPos + 13 + pos * 11, xPos + 100, yPos + 24 + pos * 11, 0x80FFFFFF); drawRect(xPos, yPos + 13 + pos * 11, xPos + 100, yPos + 23 + pos * 11, 0xC0000000 | team.getValue0()); this.p_statRenderer.drawString(text, xPos + 50 - this.p_statRenderer.getStringWidth(text) / 2, yPos + 14 + pos * 11, getContrastTextColor(team.getValue0())); GL11.glPushMatrix(); GL11.glScalef(0.5F, 0.5F, 0.5F); ItemRenderHelper.renderItemInGui(mc, team.getValue3(), xPos * 2, (yPos + 14 + pos * 11) * 2); GL11.glDisable(GL11.GL_LIGHTING); GL11.glPopMatrix(); pos++; } drawRect(xPos - 1, yPos + 13, xPos, yPos + 13 + pos * 11, 0xC0000000); drawRect(xPos + 100, yPos + 13, xPos + 101, yPos + 13 + pos * 11, 0xC0000000); this.drawGradientRect(xPos - 1, yPos + 13 + pos * 11, xPos, yPos + 19 + pos * 11, 0xC0000000, 0x00000000); this.drawGradientRect(xPos + 100, yPos + 13 + pos * 11, xPos + 101, yPos + 19 + pos * 11, 0xC0000000, 0x00000000); this.drawGradientRect(xPos, yPos + 13 + pos * 11, xPos + 100, yPos + 18 + pos * 11, 0x80FFFFFF, 0x00000000); }
From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierBodyRenderHandler.java
License:Creative Commons License
@SubscribeEvent public void onSoldierLivingRender(SoldierRenderEvent.RenderLivingEvent event) { if (event.clayMan.hasUpgrade(SoldierUpgrades.UPG_IRON_INGOT)) { GL11.glScalef(1.19F, 1.19F, 1.19F); }/*from www .j a v a 2s . c o m*/ if (event.clayMan.hasUpgrade(SoldierUpgrades.UPG_ENDERPEARL)) { GL11.glColor3f(0.5F, 0.5F, 0.5F); } }
From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierBodyRenderHandler.java
License:Creative Commons License
private void renderFeather(EntityClayMan clayMan, RenderClayMan renderer) { GL11.glPushMatrix();// w w w . j a v a 2 s .c o m renderer.modelBipedMain.bipedBody.postRender(0.0625F); GL11.glTranslatef(0.0F, -0.6F, 0.0F); float itemScale = 1.5F; GL11.glScalef(itemScale, itemScale, itemScale); GL11.glTranslatef(0.6F, 0.05F, 0.0F); GL11.glRotatef(22.5F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(90.0F, -1.0F, 0.0F, 1.0F); renderer.getItemRenderer().renderItem(clayMan, this.p_feather, 0); GL11.glPopMatrix(); }
From source file:de.sanandrew.mods.claysoldiers.client.event.SoldierBodyRenderHandler.java
License:Creative Commons License
private void renderGlass(EntityClayMan clayMan, RenderClayMan renderer) { GL11.glPushMatrix();//from ww w . j av a2 s.co m renderer.modelBipedMain.bipedHead.postRender(0.0625F); GL11.glTranslatef(0.0F, -0.6F, 0.0F); float itemScale = 0.18F; GL11.glScalef(itemScale, itemScale, itemScale); GL11.glTranslatef(0.84F, 1.5F, -1.1F); short color = clayMan.getUpgrade(SoldierUpgrades.getUpgrade(SoldierUpgrades.UPG_GLASS)).getNbtTag() .getShort("leftColor"); if (color < 0) { renderer.getItemRenderer().renderItem(clayMan, this.p_glass, 0); } else { this.p_glassStained.setItemDamage(color); renderer.getItemRenderer().renderItem(clayMan, this.p_glassStained, 0); } GL11.glTranslatef(-1.68F, 0.0F, 0.0F); color = clayMan.getUpgrade(SoldierUpgrades.getUpgrade(SoldierUpgrades.UPG_GLASS)).getNbtTag() .getShort("rightColor"); if (color < 0) { renderer.getItemRenderer().renderItem(clayMan, this.p_glass, 0); } else { this.p_glassStained.setItemDamage(color); renderer.getItemRenderer().renderItem(clayMan, this.p_glassStained, 0); } GL11.glPopMatrix(); }