public int getTexture(String par1Str)
    {
        TexturePackBase var2 = this.texturePack.selectedTexturePack;
        Integer var3 = (Integer)this.textureMap.get(par1Str);

        if (var3 != null)
        {
            return var3.intValue();
        }
        else
        {
            try
            {
                if (Tessellator.renderingWorldRenderer)
                {
                    System.out.printf("Warning: Texture %s not preloaded, will cause render glitches!\n", par1Str);
                }
                this.singleIntBuffer.clear();
                GLAllocation.generateTextureNames(this.singleIntBuffer);
                int var6 = this.singleIntBuffer.get(0);

                if (par1Str.startsWith("##"))
                {
                    this.setupTexture(this.unwrapImageByColumns(this.readTextureImage(var2.getResourceAsStream(par1Str.substring(2)))), var6);
                }
                else if (par1Str.startsWith("%clamp%"))
                {
                    this.clampTexture = true;
                    this.setupTexture(this.readTextureImage(var2.getResourceAsStream(par1Str.substring(7))), var6);
                    this.clampTexture = false;
                }
                else if (par1Str.startsWith("%blur%"))
                {
                    this.blurTexture = true;
                    this.setupTexture(this.readTextureImage(var2.getResourceAsStream(par1Str.substring(6))), var6);
                    this.blurTexture = false;
                }
                else if (par1Str.startsWith("%blurclamp%"))
                {
                    this.blurTexture = true;
                    this.clampTexture = true;
                    this.setupTexture(this.readTextureImage(var2.getResourceAsStream(par1Str.substring(11))), var6);
                    this.blurTexture = false;
                    this.clampTexture = false;
                }
                else
                {
                    InputStream var7 = var2.getResourceAsStream(par1Str);

                    if (var7 == null)
                    {
                        this.setupTexture(this.missingTextureImage, var6);
                    }
                    else
                    {
                        this.setupTexture(this.readTextureImage(var7), var6);
                    }
                }

                this.textureMap.put(par1Str, Integer.valueOf(var6));
                ForgeHooksClient.onTextureLoad(par1Str, var6);
                return var6;
            }
            catch (Exception var5)
            {
                var5.printStackTrace();
                GLAllocation.generateTextureNames(this.singleIntBuffer);
                int var4 = this.singleIntBuffer.get(0);
                this.setupTexture(this.missingTextureImage, var4);
                this.textureMap.put(par1Str, Integer.valueOf(var4));
                return var4;
            }
        }
    }