@Override public void renderEquippedItems( IRenderAccess renderer, EntityLiving par1EntityLiving, float par2) { ItemStack itemstack = new ItemStack(Block.pumpkin, 1); ModelSnowMan snowmanModel = (ModelSnowMan) renderer.getMainModel(); if (itemstack != null && itemstack.getItem() instanceof ItemBlock) { GL11.glPushMatrix(); snowmanModel.head.postRender(0.0625F); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) { float f1 = 0.625F; GL11.glTranslatef(0.0F, -0.34375F, 0.0F); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f1, -f1, f1); } renderer.getRenderManager().itemRenderer.renderItem(par1EntityLiving, itemstack, 0); GL11.glPopMatrix(); } }
protected void renderEquippedItems(EntityLiving var1, float var2) { super.renderEquippedItems(var1, var2); ItemStack var3 = var1.getHeldItem(); if (var3 != null) { GL11.glPushMatrix(); this.modelBipedMain.bipedRightArm.postRender(0.0625F); GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); IItemRenderer var5 = MinecraftForgeClient.getItemRenderer(var3, IItemRenderer.ItemRenderType.EQUIPPED); boolean var6 = var5 != null && var5.shouldUseRenderHelper( IItemRenderer.ItemRenderType.EQUIPPED, var3, IItemRenderer.ItemRendererHelper.BLOCK_3D); float var4; if (var3.getItem() instanceof ItemBlock && (var6 || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))) { var4 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); var4 *= 0.75F; GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(var4, -var4, var4); } else if (Item.itemsList[var3.itemID].isFull3D()) { var4 = 0.625F; GL11.glTranslatef(0.0F, 0.1875F, 0.0F); GL11.glScalef(var4, -var4, var4); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else { var4 = 0.375F; GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); GL11.glScalef(var4, var4, var4); GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); } this.renderManager.itemRenderer.renderItem(var1, var3, 0); if (var3.getItem().requiresMultipleRenderPasses()) { for (int var7 = 1; var7 < var3.getItem().getRenderPasses(var3.getItemDamage()); ++var7) { this.renderManager.itemRenderer.renderItem(var1, var3, var7); } } GL11.glPopMatrix(); } }
protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { float var3 = 1.0F; GL11.glColor3f(var3, var3, var3); super.renderEquippedItems(par1EntityLiving, par2); ItemStack var4 = par1EntityLiving.getHeldItem(); if (var4 != null) { GL11.glPushMatrix(); ModelGaiaNaga.rightarmlower.postRender(0.0625F); GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var4, ItemRenderType.EQUIPPED); boolean is3D = customRenderer != null && customRenderer.shouldUseRenderHelper( ItemRenderType.EQUIPPED, var4, ItemRendererHelper.BLOCK_3D); float x; if (var4.getItem() instanceof ItemBlock && (is3D || (Block.getBlockFromItem(var4.getItem()) != null && RenderBlocks.renderItemIn3d( Block.getBlockFromItem(var4.getItem()).getRenderType())))) { x = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); x *= 0.75F; GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(x, -x, x); } else if (var4.getItem() == Items.bow) { x = 0.625F; GL11.glTranslatef(0.0F, 0.125F, 0.3125F); GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(x, -x, x); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else if (var4.getItem().isFull3D()) { x = 0.625F; if (var4.getItem().shouldRotateAroundWhenRendering()) { GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -0.125F, 0.0F); } this.func_82422_c(); GL11.glScalef(x, -x, x); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else { x = 0.375F; GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); GL11.glScalef(x, x, x); GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); } this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 0); if (var4.getItem().requiresMultipleRenderPasses()) { for (int var8 = 1; var8 < var4.getItem().getRenderPasses(var4.getItemDamage()); ++var8) { this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, var8); } } GL11.glPopMatrix(); } }
// 独自の手に持ったアイテムの描画(ModelBiped) private void renderEquippedItems(EntityLiving par1Entity, float par2) { GL11.glColor3f(1.0F, 1.0F, 1.0F); super.renderEquippedItems(par1Entity, par2); ItemStack itemstack = par1Entity.getHeldItem(); ItemStack itemstack1 = par1Entity.func_130225_q(3); Item item; float f1; if (itemstack1 != null) { GL11.glPushMatrix(); // this.modelBipedMain.bipedHead.postRender( 0.0625F ); item = itemstack1.getItem(); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED); boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D)); if (item instanceof ItemBlock) { if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())) { f1 = 0.625F; GL11.glTranslatef(0.0F, -0.25F, 0.0F); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f1, -f1, -f1); } this.renderManager.itemRenderer.renderItem(par1Entity, itemstack1, 0); } else if (item == Items.skull) { f1 = 1.0625F; GL11.glScalef(f1, -f1, -f1); GameProfile gameprofile = null; if (itemstack1.hasTagCompound()) { NBTTagCompound nbttagcompound = itemstack1.getTagCompound(); if (nbttagcompound.hasKey("SkullOwner", 10)) { gameprofile = NBTUtil.func_152459_a(nbttagcompound.getCompoundTag("SkullOwner")); } else if (nbttagcompound.hasKey("SkullOwner", 8) && !StringUtils.isNullOrEmpty(nbttagcompound.getString("SkullOwner"))) { gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner")); } } TileEntitySkullRenderer.field_147536_b.func_152674_a( -0.5F, 0.0F, -0.5F, 1, 180.0F, itemstack1.getItemDamage(), gameprofile); } GL11.glPopMatrix(); } if (itemstack != null && itemstack.getItem() != null) { item = itemstack.getItem(); GL11.glPushMatrix(); if (this.mainModel.isChild) { f1 = 0.5F; GL11.glTranslatef(0.0F, 0.625F, 0.0F); GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F); GL11.glScalef(f1, f1, f1); } this.modelLivingChestMain.rightArm.postRender(0.0625F); GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); if (item instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType()))) { f1 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); f1 *= 0.75F; GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(-f1, -f1, f1); } else if (item == Items.bow) { f1 = 0.625F; GL11.glTranslatef(0.0F, 0.125F, 0.3125F); GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f1, -f1, f1); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else if (item.isFull3D()) { f1 = 0.625F; if (item.shouldRotateAroundWhenRendering()) { GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -0.125F, 0.0F); } this.func_82422_c(); GL11.glScalef(f1, -f1, f1); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else { f1 = 0.375F; GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); GL11.glScalef(f1, f1, f1); GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); } float f2; float f3; int i; if (itemstack.getItem().requiresMultipleRenderPasses()) { for (i = 0; i < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++i) { int j = itemstack.getItem().getColorFromItemStack(itemstack, i); f2 = (j >> 16 & 255) / 255.0F; f3 = (j >> 8 & 255) / 255.0F; float f4 = (j & 255) / 255.0F; GL11.glColor4f(f2, f3, f4, 1.0F); this.renderManager.itemRenderer.renderItem(par1Entity, itemstack, i); } } else { i = itemstack.getItem().getColorFromItemStack(itemstack, 0); float f5 = (i >> 16 & 255) / 255.0F; f2 = (i >> 8 & 255) / 255.0F; f3 = (i & 255) / 255.0F; GL11.glColor4f(f5, f2, f3, 1.0F); this.renderManager.itemRenderer.renderItem(par1Entity, itemstack, 0); } GL11.glPopMatrix(); } }
/** * Renders the active item in the player's hand when in first person mode. Args: partialTickTime */ public void renderItemInFirstPerson(float par1) { float f1 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * par1; EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer; float f2 = entityclientplayermp.prevRotationPitch + (entityclientplayermp.rotationPitch - entityclientplayermp.prevRotationPitch) * par1; GL11.glPushMatrix(); GL11.glRotatef(f2, 1.0F, 0.0F, 0.0F); GL11.glRotatef( entityclientplayermp.prevRotationYaw + (entityclientplayermp.rotationYaw - entityclientplayermp.prevRotationYaw) * par1, 0.0F, 1.0F, 0.0F); RenderHelper.enableStandardItemLighting(); GL11.glPopMatrix(); float f3; float f4; if (entityclientplayermp instanceof EntityPlayerSP) { EntityPlayerSP entityplayersp = (EntityPlayerSP) entityclientplayermp; f3 = entityplayersp.prevRenderArmPitch + (entityplayersp.renderArmPitch - entityplayersp.prevRenderArmPitch) * par1; f4 = entityplayersp.prevRenderArmYaw + (entityplayersp.renderArmYaw - entityplayersp.prevRenderArmYaw) * par1; GL11.glRotatef((entityclientplayermp.rotationPitch - f3) * 0.1F, 1.0F, 0.0F, 0.0F); GL11.glRotatef((entityclientplayermp.rotationYaw - f4) * 0.1F, 0.0F, 1.0F, 0.0F); } ItemStack itemstack = this.itemToRender; f3 = this.mc.theWorld.getLightBrightness( MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ)); f3 = 1.0F; int i = this.mc.theWorld.getLightBrightnessForSkyBlocks( MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ), 0); int j = i % 65536; int k = i / 65536; OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); float f5; float f6; float f7; if (itemstack != null) { i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0); f7 = (float) (i >> 16 & 255) / 255.0F; f6 = (float) (i >> 8 & 255) / 255.0F; f5 = (float) (i & 255) / 255.0F; GL11.glColor4f(f3 * f7, f3 * f6, f3 * f5, 1.0F); } else { GL11.glColor4f(f3, f3, f3, 1.0F); } float f8; float f9; float f10; Render render; RenderPlayer renderplayer; if (itemstack != null && itemstack.getItem() instanceof ItemMap) { GL11.glPushMatrix(); f4 = 0.8F; f7 = entityclientplayermp.getSwingProgress(par1); f6 = MathHelper.sin(f7 * (float) Math.PI); f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI); GL11.glTranslatef( -f5 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI * 2.0F) * 0.2F, -f6 * 0.2F); f7 = 1.0F - f2 / 45.0F + 0.1F; if (f7 < 0.0F) { f7 = 0.0F; } if (f7 > 1.0F) { f7 = 1.0F; } f7 = -MathHelper.cos(f7 * (float) Math.PI) * 0.5F + 0.5F; GL11.glTranslatef(0.0F, 0.0F * f4 - (1.0F - f1) * 1.2F - f7 * 0.5F + 0.04F, -0.9F * f4); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(f7 * -85.0F, 0.0F, 0.0F, 1.0F); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glBindTexture( GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTextureForDownloadableImage( this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture())); this.mc.renderEngine.resetBoundTexture(); for (k = 0; k < 2; ++k) { int l = k * 2 - 1; GL11.glPushMatrix(); GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float) l); GL11.glRotatef((float) (-45 * l), 1.0F, 0.0F, 0.0F); GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef((float) (-65 * l), 0.0F, 1.0F, 0.0F); render = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); renderplayer = (RenderPlayer) render; f10 = 1.0F; GL11.glScalef(f10, f10, f10); renderplayer.renderFirstPersonArm(this.mc.thePlayer); GL11.glPopMatrix(); } f6 = entityclientplayermp.getSwingProgress(par1); f5 = MathHelper.sin(f6 * f6 * (float) Math.PI); f8 = MathHelper.sin(MathHelper.sqrt_float(f6) * (float) Math.PI); GL11.glRotatef(-f5 * 20.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-f8 * 20.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-f8 * 80.0F, 1.0F, 0.0F, 0.0F); f9 = 0.38F; GL11.glScalef(f9, f9, f9); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(-1.0F, -1.0F, 0.0F); f10 = 0.015625F; GL11.glScalef(f10, f10, f10); this.mc.renderEngine.bindTexture("/misc/mapbg.png"); Tessellator tessellator = Tessellator.instance; GL11.glNormal3f(0.0F, 0.0F, -1.0F); tessellator.startDrawingQuads(); byte b0 = 7; tessellator.addVertexWithUV((double) (0 - b0), (double) (128 + b0), 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV((double) (128 + b0), (double) (128 + b0), 0.0D, 1.0D, 1.0D); tessellator.addVertexWithUV((double) (128 + b0), (double) (0 - b0), 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV((double) (0 - b0), (double) (0 - b0), 0.0D, 0.0D, 0.0D); tessellator.draw(); IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP); MapData mapdata = ((ItemMap) itemstack.getItem()).getMapData(itemstack, this.mc.theWorld); if (custom == null) { if (mapdata != null) { this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, mapdata); } } else { custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.renderEngine, mapdata); } GL11.glPopMatrix(); } else if (itemstack != null) { GL11.glPushMatrix(); f4 = 0.8F; if (entityclientplayermp.getItemInUseCount() > 0) { EnumAction enumaction = itemstack.getItemUseAction(); if (enumaction == EnumAction.eat || enumaction == EnumAction.drink) { f6 = (float) entityclientplayermp.getItemInUseCount() - par1 + 1.0F; f5 = 1.0F - f6 / (float) itemstack.getMaxItemUseDuration(); f8 = 1.0F - f5; f8 = f8 * f8 * f8; f8 = f8 * f8 * f8; f8 = f8 * f8 * f8; f9 = 1.0F - f8; GL11.glTranslatef( 0.0F, MathHelper.abs(MathHelper.cos(f6 / 4.0F * (float) Math.PI) * 0.1F) * (float) ((double) f5 > 0.2D ? 1 : 0), 0.0F); GL11.glTranslatef(f9 * 0.6F, -f9 * 0.5F, 0.0F); GL11.glRotatef(f9 * 90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(f9 * 10.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(f9 * 30.0F, 0.0F, 0.0F, 1.0F); } } else { f7 = entityclientplayermp.getSwingProgress(par1); f6 = MathHelper.sin(f7 * (float) Math.PI); f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI); GL11.glTranslatef( -f5 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI * 2.0F) * 0.2F, -f6 * 0.2F); } GL11.glTranslatef(0.7F * f4, -0.65F * f4 - (1.0F - f1) * 0.6F, -0.9F * f4); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glEnable(GL12.GL_RESCALE_NORMAL); f7 = entityclientplayermp.getSwingProgress(par1); f6 = MathHelper.sin(f7 * f7 * (float) Math.PI); f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI); GL11.glRotatef(-f6 * 20.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-f5 * 20.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-f5 * 80.0F, 1.0F, 0.0F, 0.0F); f8 = 0.4F; GL11.glScalef(f8, f8, f8); float f11; float f12; if (entityclientplayermp.getItemInUseCount() > 0) { EnumAction enumaction1 = itemstack.getItemUseAction(); if (enumaction1 == EnumAction.block) { GL11.glTranslatef(-0.5F, 0.2F, 0.0F); GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); } else if (enumaction1 == EnumAction.bow) { GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(-0.9F, 0.2F, 0.0F); f10 = (float) itemstack.getMaxItemUseDuration() - ((float) entityclientplayermp.getItemInUseCount() - par1 + 1.0F); f11 = f10 / 20.0F; f11 = (f11 * f11 + f11 * 2.0F) / 3.0F; if (f11 > 1.0F) { f11 = 1.0F; } if (f11 > 0.1F) { GL11.glTranslatef( 0.0F, MathHelper.sin((f10 - 0.1F) * 1.3F) * 0.01F * (f11 - 0.1F), 0.0F); } GL11.glTranslatef(0.0F, 0.0F, f11 * 0.1F); GL11.glRotatef(-335.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.0F, 0.5F, 0.0F); f12 = 1.0F + f11 * 0.2F; GL11.glScalef(1.0F, 1.0F, f12); GL11.glTranslatef(0.0F, -0.5F, 0.0F); GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); } } if (itemstack.getItem().shouldRotateAroundWhenRendering()) { GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); } if (itemstack.getItem().requiresMultipleRenderPasses()) { this.renderItem(entityclientplayermp, itemstack, 0); for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++) { int i1 = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, x); f10 = (float) (i1 >> 16 & 255) / 255.0F; f11 = (float) (i1 >> 8 & 255) / 255.0F; f12 = (float) (i1 & 255) / 255.0F; GL11.glColor4f(f3 * f10, f3 * f11, f3 * f12, 1.0F); this.renderItem(entityclientplayermp, itemstack, x); } } else { this.renderItem(entityclientplayermp, itemstack, 0); } GL11.glPopMatrix(); } else if (!entityclientplayermp.getHasActivePotion()) { GL11.glPushMatrix(); f4 = 0.8F; f7 = entityclientplayermp.getSwingProgress(par1); f6 = MathHelper.sin(f7 * (float) Math.PI); f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI); GL11.glTranslatef( -f5 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI * 2.0F) * 0.4F, -f6 * 0.4F); GL11.glTranslatef(0.8F * f4, -0.75F * f4 - (1.0F - f1) * 0.6F, -0.9F * f4); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glEnable(GL12.GL_RESCALE_NORMAL); f7 = entityclientplayermp.getSwingProgress(par1); f6 = MathHelper.sin(f7 * f7 * (float) Math.PI); f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI); GL11.glRotatef(f5 * 70.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-f6 * 20.0F, 0.0F, 0.0F, 1.0F); GL11.glBindTexture( GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTextureForDownloadableImage( this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture())); this.mc.renderEngine.resetBoundTexture(); GL11.glTranslatef(-1.0F, 3.6F, 3.5F); GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glTranslatef(5.6F, 0.0F, 0.0F); render = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); renderplayer = (RenderPlayer) render; f10 = 1.0F; GL11.glScalef(f10, f10, f10); renderplayer.renderFirstPersonArm(this.mc.thePlayer); GL11.glPopMatrix(); } GL11.glDisable(GL12.GL_RESCALE_NORMAL); RenderHelper.disableStandardItemLighting(); }
protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2) { float f1 = 1.0F; GL11.glColor3f(f1, f1, f1); super.renderEquippedItems(par1EntityLiving, par2); ItemStack itemstack = par1EntityLiving.getHeldItem(); ItemStack itemstack1 = par1EntityLiving.getCurrentArmor(3); float f2; if (itemstack1 != null) { GL11.glPushMatrix(); this.modelBipedMain.bipedHead.postRender(0.0625F); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED); boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D)); if (itemstack1.getItem() instanceof ItemBlock) { if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())) { f2 = 0.625F; GL11.glTranslatef(0.0F, -0.25F, 0.0F); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f2, -f2, -f2); } this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack1, 0); } else if (itemstack1.getItem().itemID == Item.skull.itemID) { f2 = 1.0625F; GL11.glScalef(f2, -f2, -f2); String s = ""; if (itemstack1.hasTagCompound() && itemstack1.getTagCompound().hasKey("SkullOwner")) { s = itemstack1.getTagCompound().getString("SkullOwner"); } TileEntitySkullRenderer.skullRenderer.func_82393_a( -0.5F, 0.0F, -0.5F, 1, 180.0F, itemstack1.getItemDamage(), s); } GL11.glPopMatrix(); } if (itemstack != null) { GL11.glPushMatrix(); if (this.mainModel.isChild) { f2 = 0.5F; GL11.glTranslatef(0.0F, 0.625F, 0.0F); GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F); GL11.glScalef(f2, f2, f2); } this.modelBipedMain.bipedRightArm.postRender(0.0625F); GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); if (itemstack.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))) { f2 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); f2 *= 0.75F; GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(-f2, -f2, f2); } else if (itemstack.itemID == Item.bow.itemID) { f2 = 0.625F; GL11.glTranslatef(0.0F, 0.125F, 0.3125F); GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f2, -f2, f2); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else if (Item.itemsList[itemstack.itemID].isFull3D()) { f2 = 0.625F; if (Item.itemsList[itemstack.itemID].shouldRotateAroundWhenRendering()) { GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -0.125F, 0.0F); } this.func_82422_c(); GL11.glScalef(f2, -f2, f2); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else { f2 = 0.375F; GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); GL11.glScalef(f2, f2, f2); GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); } this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, 0); if (itemstack.getItem().requiresMultipleRenderPasses()) { for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++) { this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, x); } } GL11.glPopMatrix(); } }