private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon) { float f = par2Icon.getMinU(); float f1 = par2Icon.getMaxU(); float f2 = par2Icon.getMinV(); float f3 = par2Icon.getMaxV(); float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3); par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3); par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2); par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2); par1Tessellator.draw(); }
public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if(player.getItemInUse() == null) return this.itemIcon; int Pulling = stack.getMaxItemUseDuration() - useRemaining; if (Pulling >= 50) { return Texture[3]; } else if (Pulling > 34) { return Texture[2]; } else if (Pulling > 18) { return Texture[1]; } return Texture[0]; }
@Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister reg) { if(isVChain()) { ironChain = new Icon[4]; ironChain[0] = reg.registerIcon("MineFantasy:Apparel/ironChainHelmet"); ironChain[1] = reg.registerIcon("MineFantasy:Apparel/ironChainChest"); ironChain[2] = reg.registerIcon("MineFantasy:Apparel/ironChainLegs"); ironChain[3] = reg.registerIcon("MineFantasy:Apparel/ironChainBoots"); } else super.registerIcons(reg); }
private void func_77026_a(Tessellator p_77026_1_, Icon p_77026_2_) { float var3 = p_77026_2_.func_94209_e(); float var4 = p_77026_2_.func_94212_f(); float var5 = p_77026_2_.func_94206_g(); float var6 = p_77026_2_.func_94210_h(); float var7 = 1.0F; float var8 = 0.5F; float var9 = 0.25F; GL11.glRotatef(180.0F - this.field_76990_c.field_78735_i, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.field_76990_c.field_78732_j, 1.0F, 0.0F, 0.0F); p_77026_1_.func_78382_b(); p_77026_1_.func_78375_b(0.0F, 1.0F, 0.0F); p_77026_1_.func_78374_a((double)(0.0F - var8), (double)(0.0F - var9), 0.0D, (double)var3, (double)var6); p_77026_1_.func_78374_a((double)(var7 - var8), (double)(0.0F - var9), 0.0D, (double)var4, (double)var6); p_77026_1_.func_78374_a((double)(var7 - var8), (double)(var7 - var9), 0.0D, (double)var4, (double)var5); p_77026_1_.func_78374_a((double)(0.0F - var8), (double)(var7 - var9), 0.0D, (double)var3, (double)var5); p_77026_1_.func_78381_a(); }
/** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f); if (icon != null) { GL11.glPushMatrix(); GL11.glTranslatef((float)par2, (float)par4, (float)par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.5F, 0.5F, 0.5F); this.bindEntityTexture(par1Entity); Tessellator tessellator = Tessellator.instance; if (icon == ItemPotion.func_94589_d("bottle_splash")) { int i = PotionHelper.func_77915_a(((EntityPotion)par1Entity).getPotionDamage(), false); float f2 = (float)(i >> 16 & 255) / 255.0F; float f3 = (float)(i >> 8 & 255) / 255.0F; float f4 = (float)(i & 255) / 255.0F; GL11.glColor3f(f2, f3, f4); GL11.glPushMatrix(); this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay")); GL11.glPopMatrix(); GL11.glColor3f(1.0F, 1.0F, 1.0F); } this.func_77026_a(tessellator, icon); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } }
@Override @SideOnly(Side.CLIENT) public Icon getIconFromDamageForRenderPass(int damage, int pass) { if ( pass != 0 ) { return getIconFromDamage( damage ); } return Item.potion.getIconFromDamageForRenderPass( damage, pass ); }
@SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return this.iconArray[0]; }
@SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { if (par2 >= this.iconArray.length) { par2 = 0; } return this.iconArray[par2]; }
@SideOnly(Side.CLIENT) public void func_94332_a(IconRegister p_94332_1_) { this.field_94363_a = new Icon[8]; for(int var2 = 0; var2 < this.field_94363_a.length; ++var2) { this.field_94363_a[var2] = p_94332_1_.func_94245_a(this.func_111023_E() + "_stage_" + var2); } }
protected void func_130015_b(float p_130015_1_, int p_130015_2_, int p_130015_3_) { if(p_130015_1_ < 1.0F) { p_130015_1_ *= p_130015_1_; p_130015_1_ *= p_130015_1_; p_130015_1_ = p_130015_1_ * 0.8F + 0.2F; } GL11.glDisable(3008); GL11.glDisable(2929); GL11.glDepthMask(false); GL11.glBlendFunc(770, 771); GL11.glColor4f(1.0F, 1.0F, 1.0F, p_130015_1_); Icon var4 = Block.field_72015_be.func_71851_a(1); this.field_73839_d.func_110434_K().func_110577_a(TextureMap.field_110575_b); float var5 = var4.func_94209_e(); float var6 = var4.func_94206_g(); float var7 = var4.func_94212_f(); float var8 = var4.func_94210_h(); Tessellator var9 = Tessellator.field_78398_a; var9.func_78382_b(); var9.func_78374_a(0.0D, (double)p_130015_3_, -90.0D, (double)var5, (double)var8); var9.func_78374_a((double)p_130015_2_, (double)p_130015_3_, -90.0D, (double)var7, (double)var8); var9.func_78374_a((double)p_130015_2_, 0.0D, -90.0D, (double)var7, (double)var6); var9.func_78374_a(0.0D, 0.0D, -90.0D, (double)var5, (double)var6); var9.func_78381_a(); GL11.glDepthMask(true); GL11.glEnable(2929); GL11.glEnable(3008); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); }
@SideOnly(Side.CLIENT) /** * When this method is called, your block should register all the icons it needs with the given IconRegister. This * is the only chance you get to register icons. */ public void registerIcons(IconRegister par1IconRegister) { this.iconArray = new Icon[3]; for (int i = 0; i < this.iconArray.length; ++i) { this.iconArray[i] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + i); } }
@SideOnly(Side.CLIENT) /** * The icon for the tops and bottoms of the block. */ protected Icon getEndIcon(int par1) { return this.tree_top[par1]; }
@SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister){ icons = new Icon[2]; for (int i = 0; i < icons.length; i++){ icons[i] = par1IconRegister.registerIcon(UniversalCoins.modid + ":" + this.getUnlocalizedName().substring(5) + i); } }
@SideOnly(Side.CLIENT) /** * When this method is called, your block should register all the icons it needs with the given IconRegister. This * is the only chance you get to register icons. */ public void registerIcons(IconRegister par1IconRegister) { //this.iconArray = new Icon[] { par1IconRegister.registerIcon(Main.modid + ":" + "RuneFire_" + Color + "_0"), par1IconRegister.registerIcon(Main.modid + ":" + "RuneFire_" + Color + "_1") }; this.iconArray = new Icon[] { par1IconRegister.registerIcon(RunesAndSilver.modid + ":" + "RuneFire_Red" + "_0"), par1IconRegister.registerIcon(RunesAndSilver.modid + ":" + "RuneFire_Red" + "_1")}; }
@SideOnly(Side.CLIENT) /** * Returns the icon index on items.png that is used as background image of the slot. */ public Icon getBackgroundIconIndex () { return ItemArmor.func_94602_b(this.armorType); }
public void registerIcons(IconRegister register) { icon = new Icon[3]; for (int i = 0; i < icon.length; i++) { icon[i] = register.registerIcon("exaliquo:" + Registries.oreType[i] + "/Block" + name + Registries.oreType[i]); } }
@Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister){ icons = new Icon[2]; //registers the block texture to block //blockIcon = iconRegister.registerIcon(String.format("%s:%s", Reference.MODID.toLowerCase(), getUnwrappedUnlocalizedName(this.getUnlocalizedName()))); icons[0] = iconRegister.registerIcon( Reference.MODID.toLowerCase() + ":" + "tutFluid_still"); icons[1] = iconRegister.registerIcon( Reference.MODID.toLowerCase() + ":" + "tutFluid_flow"); }
/** * Renders the face on the negative x side with optional texture offsets. * @param xOffset * The offset on the x-axis. * @param yOffset * The offset on the y-axis. * @param zOffset * The offset on the z-axis. * @param height * The faces height. * @param depth * The faces depth. * @param uOffset * The texture offset on the u-axis. * @param vOffset * The texture offset on the v-axis. * @param uMaxOffset * The max texture offset on the u-axis. * @param vMaxOffset * The max texture offset on the v-axis. * @param icon * The faces texture. * @param scale * The value to scale the offsets with. */ public static void renderNegativeXFace(double xOffset, double yOffset, double zOffset, double height, double depth, double uOffset, double vOffset, double uMaxOffset, double vMaxOffset, Icon icon, double scale) { tr.setNormal(-1f, 0f, 0f); double x = xBaseCoord + xOffset * scale; // bottom left double zBl = zBaseCoord + zOffset * scale; double yBl = yBaseCoord + yOffset * scale; // bottom right double zBr = zBaseCoord + (zOffset + depth) * scale; double yBr = yBaseCoord + yOffset * scale; // top right double zTr = zBaseCoord + (zOffset + depth) * scale; double yTr = yBaseCoord + (yOffset + height) * scale; // top left double zTl = zBaseCoord + zOffset * scale; double yTl = yBaseCoord + (yOffset + height) * scale; double minU = (uOffset > 0 && uOffset < 16) ? icon.getMinU() + (icon.getInterpolatedU(uOffset) - icon.getMinU()) : icon.getMinU(); double maxU = (uMaxOffset > 0 && uMaxOffset < 16) ? icon.getMaxU() - (icon.getMaxU() - icon.getInterpolatedU(uMaxOffset)) : icon.getMaxU(); double minV = (vOffset > 0 && vOffset < 16) ? icon.getMinV() + (icon.getInterpolatedV(vOffset) - icon.getMinV()) : icon.getMinV(); double maxV = (vMaxOffset > 0 && vMaxOffset < 16) ? icon.getMaxV() - (icon.getMaxV() - icon.getInterpolatedV(vMaxOffset)) : icon.getMaxV(); // bottom left tr.addVertexWithUV(x, yBl, zBl, minU, maxV); // bottom right tr.addVertexWithUV(x, yBr, zBr, maxU, maxV); // top right tr.addVertexWithUV(x, yTr, zTr, maxU, minV); // top left tr.addVertexWithUV(x, yTl, zTl, minU, minV); }
/** * Renders the fire on the screen for first person mode. Arg: partialTickTime */ private void renderFireInFirstPerson(float par1) { Tessellator tessellator = Tessellator.instance; GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); float f1 = 1.0F; for (int i = 0; i < 2; ++i) { GL11.glPushMatrix(); Icon icon = Block.fire.getFireIcon(1); this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); float f2 = icon.getMinU(); float f3 = icon.getMaxU(); float f4 = icon.getMinV(); float f5 = icon.getMaxV(); float f6 = (0.0F - f1) / 2.0F; float f7 = f6 + f1; float f8 = 0.0F - f1 / 2.0F; float f9 = f8 + f1; float f10 = -0.5F; GL11.glTranslatef((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F); GL11.glRotatef((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double)f6, (double)f8, (double)f10, (double)f3, (double)f5); tessellator.addVertexWithUV((double)f7, (double)f8, (double)f10, (double)f2, (double)f5); tessellator.addVertexWithUV((double)f7, (double)f9, (double)f10, (double)f2, (double)f4); tessellator.addVertexWithUV((double)f6, (double)f9, (double)f10, (double)f3, (double)f4); tessellator.draw(); GL11.glPopMatrix(); } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); }
private void renderHungItem(TileEntityTanningRack tile, double d, double d1, double d2, float f) { Minecraft mc = Minecraft.getMinecraft(); ItemStack itemstack = tile.getHung(); if(itemstack != null) { Item item = itemstack.getItem(); mc.renderEngine.bindTexture(TextureMap.locationItemsTexture); Tessellator image = Tessellator.instance; Icon index = item.getIconFromDamage(itemstack.getItemDamage()); float x1 = index.getMinU(); float x2 = index.getMaxU(); float y1 = index.getMinV(); float y2 = index.getMaxV(); float xPos = 0.5F; float yPos = -0.5F; GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glTranslatef(-xPos, -yPos, 0.0F); float var13 = 1F; GL11.glScalef(var13, var13, var13); //GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(-1F, -1F, 0.0F); ItemRenderer.renderItemIn2D(image, x2, y1, x1, y2, index.getIconWidth(), index.getIconHeight(), 0.0625F); } }
@Override public Icon getIcon(int side, int meta) { switch (side) { case 0: case 1: return topIcon; case 4: return frontIcon; default: return sideIcon; } }
@SideOnly(Side.CLIENT) /** * Returns the icon index of the current stack. */ public Icon getIconIndex() { return this.getItem().getIconIndex(this); }
@SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.hopperTopIcon : this.hopperIcon; }
@SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return Block.stone.getBlockTextureFromSide(1); }
@Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister icon) { icons = new Icon[11]; for(int i = 0; i < icons.length; i++) { icons[i] = icon.registerIcon(Reference.MODID.toLowerCase() + ":" + Strings.UNLOC_ITEM_GRIMOIREPAGE); } }
@SideOnly(Side.CLIENT) public Icon func_71895_b(IBlockAccess p_71895_1_, int p_71895_2_, int p_71895_3_, int p_71895_4_, int p_71895_5_) { if(p_71895_5_ != 1 && p_71895_5_ != 0) { int var6 = this.func_72234_b_(p_71895_1_, p_71895_2_, p_71895_3_, p_71895_4_); int var7 = var6 & 3; boolean var8 = (var6 & 4) != 0; boolean var9 = false; boolean var10 = (var6 & 8) != 0; if(var8) { if(var7 == 0 && p_71895_5_ == 2) { var9 = !var9; } else if(var7 == 1 && p_71895_5_ == 5) { var9 = !var9; } else if(var7 == 2 && p_71895_5_ == 3) { var9 = !var9; } else if(var7 == 3 && p_71895_5_ == 4) { var9 = !var9; } } else { if(var7 == 0 && p_71895_5_ == 5) { var9 = !var9; } else if(var7 == 1 && p_71895_5_ == 3) { var9 = !var9; } else if(var7 == 2 && p_71895_5_ == 4) { var9 = !var9; } else if(var7 == 3 && p_71895_5_ == 2) { var9 = !var9; } if((var6 & 16) != 0) { var9 = !var9; } } return var10?this.field_111044_a[var9?1:0]:this.field_111043_b[var9?1:0]; } else { return this.field_111043_b[0]; } }
public void setBlockIcon(Block block, Icon icon) { if (block == null || icon == null) return; try { ReflectionHelper.setPrivateValue(Block.class, block, icon, ObfuscationReflectionHelper.remapFieldNames(Block.class.getName(), "blockIcon", "field_94336_cN", "cW")); } catch (Exception e) { e.printStackTrace(); } }
public void registerIcons(IconRegister register) { icon = new Icon[3]; for (int i = 0; i < icon.length; i++) { icon[i] = register.registerIcon("exaliquo:" + Registries.oreType[i] + "/Item" + name + Registries.oreType[i]); } }
@SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_standby"); this.iconArray = new Icon[bowPullIconNameArray.length]; for (int i = 0; i < this.iconArray.length; ++i) { this.iconArray[i] = par1IconRegister.registerIcon(this.getIconString() + "_" + bowPullIconNameArray[i]); } }
@SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.field_94474_b : (par1 == 0 ? this.field_94474_b : (par2 == 2 && par1 == 2 ? this.field_94475_c : (par2 == 3 && par1 == 5 ? this.field_94475_c : (par2 == 0 && par1 == 3 ? this.field_94475_c : (par2 == 1 && par1 == 4 ? this.field_94475_c : this.blockIcon))))); }
@SideOnly(Side.CLIENT) /** * Returns the icon index of the stack given as argument. */ public Icon getIconIndex(ItemStack par1ItemStack) { return this.getIconFromDamage(par1ItemStack.getItemDamage()); }
/** * Sprite the crop is meant to be rendered with. * * @param crop reference to ICropTile * @return 0-255, representing the sprite index on the crop's spritesheet. */ @SideOnly(Side.CLIENT) public Icon getSprite(ICropTile crop) { if (crop.getSize() <= 0 || crop.getSize() > textures.length) return null; return textures[crop.getSize() - 1]; }
@Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister register) { icon = new Icon[3]; for (int i = 0; i < icon.length; i++) { icon[i] = register.registerIcon("exaliquo:" + Registries.oreType[i] + "/Block" + this.getUnlocalizedName().substring(5) + Registries.oreType[i]); } }
/** * Gets the block's texture. Args: side, meta */ @SideOnly(Side.CLIENT) public Icon getIcon(int p_149691_1_, int p_149691_2_) { if (p_149691_2_ == 0 && p_149691_1_ == 3) return field_149936_O; return p_149691_1_ == 1 ? this.field_149935_N : (p_149691_1_ == 0 ? this.field_149935_N : (p_149691_1_ != p_149691_2_ ? this.blockIcon : this.field_149936_O)); }