Java 类net.minecraft.client.resources.data.TextureMetadataSection 实例源码

项目:Backmemed    文件:SimpleShaderTexture.java   
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    this.deleteGlTexture();
    InputStream inputstream = Shaders.getShaderPackResourceStream(this.texturePath);

    if (inputstream == null)
    {
        throw new FileNotFoundException("Shader texture not found: " + this.texturePath);
    }
    else
    {
        try
        {
            BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream);
            TextureMetadataSection texturemetadatasection = this.loadTextureMetadataSection();
            TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, texturemetadatasection.getTextureBlur(), texturemetadatasection.getTextureClamp());
        }
        finally
        {
            IOUtils.closeQuietly(inputstream);
        }
    }
}
项目:DecompiledMinecraft    文件:Minecraft.java   
private void registerMetadataSerializers()
{
    this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
}
项目:BaseClient    文件:Minecraft.java   
private void registerMetadataSerializers()
{
    this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
}
项目:BaseClient    文件:Minecraft.java   
private void registerMetadataSerializers() {
    this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(),
            TextureMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(),
            FontMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(),
            AnimationMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(),
            PackMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(),
            LanguageMetadataSection.class);
}
项目:Zombe-Modpack    文件:Minecraft.java   
private void registerMetadataSerializers()
{
    this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
}
项目:Backmemed    文件:SimpleShaderTexture.java   
private static MetadataSerializer makeMetadataSerializer()
{
    MetadataSerializer metadataserializer = new MetadataSerializer();
    metadataserializer.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
    metadataserializer.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
    metadataserializer.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
    metadataserializer.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
    metadataserializer.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
    return metadataserializer;
}
项目:Backmemed    文件:Minecraft.java   
private void registerMetadataSerializers()
{
    this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
}
项目:CustomWorldGen    文件:SimpleTexture.java   
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    this.deleteGlTexture();
    IResource iresource = null;

    try
    {
        iresource = resourceManager.getResource(this.textureLocation);
        BufferedImage bufferedimage = TextureUtil.readBufferedImage(iresource.getInputStream());
        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                LOG.warn("Failed reading metadata of: {}", new Object[] {this.textureLocation, runtimeexception});
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        IOUtils.closeQuietly((Closeable)iresource);
    }
}
项目:CustomWorldGen    文件:Minecraft.java   
private void registerMetadataSerializers()
{
    this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
}
项目:ExpandedRailsMod    文件:SimpleTexture.java   
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    this.deleteGlTexture();
    IResource iresource = null;

    try
    {
        iresource = resourceManager.getResource(this.textureLocation);
        BufferedImage bufferedimage = TextureUtil.readBufferedImage(iresource.getInputStream());
        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                LOG.warn("Failed reading metadata of: {}", new Object[] {this.textureLocation, runtimeexception});
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        IOUtils.closeQuietly((Closeable)iresource);
    }
}
项目:ExpandedRailsMod    文件:Minecraft.java   
private void registerMetadataSerializers()
{
    this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
    this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
}
项目:RuneCraftery    文件:SimpleTexture.java   
public void func_110551_a(ResourceManager p_110551_1_) throws IOException {
   InputStream var2 = null;

   try {
      Resource var3 = p_110551_1_.func_110536_a(this.field_110568_b);
      var2 = var3.func_110527_b();
      BufferedImage var4 = ImageIO.read(var2);
      boolean var5 = false;
      boolean var6 = false;
      if(var3.func_110528_c()) {
         try {
            TextureMetadataSection var7 = (TextureMetadataSection)var3.func_110526_a("texture");
            if(var7 != null) {
               var5 = var7.func_110479_a();
               var6 = var7.func_110480_b();
            }
         } catch (RuntimeException var11) {
            Minecraft.func_71410_x().func_98033_al().func_98235_b("Failed reading metadata of: " + this.field_110568_b, var11);
         }
      }

      TextureUtil.func_110989_a(this.func_110552_b(), var4, var5, var6);
   } finally {
      if(var2 != null) {
         var2.close();
      }

   }

}
项目:RuneCraftery    文件:SimpleTexture.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    InputStream inputstream = null;

    try
    {
        Resource resource = par1ResourceManager.getResource(this.textureLocation);
        inputstream = resource.getInputStream();
        BufferedImage bufferedimage = ImageIO.read(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (resource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)resource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                Minecraft.getMinecraft().getLogAgent().logWarningException("Failed reading metadata of: " + this.textureLocation, runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:BetterNutritionMod    文件:SimpleTexture.java   
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    InputStream inputstream = null;

    try
    {
        Resource resource = par1ResourceManager.getResource(this.textureLocation);
        inputstream = resource.getInputStream();
        BufferedImage bufferedimage = ImageIO.read(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (resource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)resource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                Minecraft.getMinecraft().getLogAgent().logWarningException("Failed reading metadata of: " + this.textureLocation, runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:DecompiledMinecraft    文件:SimpleTexture.java   
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    this.deleteGlTexture();
    InputStream inputstream = null;

    try
    {
        IResource iresource = resourceManager.getResource(this.textureLocation);
        inputstream = iresource.getInputStream();
        BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                logger.warn((String)("Failed reading metadata of: " + this.textureLocation), (Throwable)runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:BaseClient    文件:SimpleTexture.java   
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    this.deleteGlTexture();
    InputStream inputstream = null;

    try
    {
        IResource iresource = resourceManager.getResource(this.textureLocation);
        inputstream = iresource.getInputStream();
        BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                logger.warn((String)("Failed reading metadata of: " + this.textureLocation), (Throwable)runtimeexception);
            }
        }

        if (Config.isShaders())
        {
            ShadersTex.loadSimpleTexture(this.getGlTextureId(), bufferedimage, flag, flag1, resourceManager, this.textureLocation, this.getMultiTexID());
        }
        else
        {
            TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
        }
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:BaseClient    文件:SimpleTexture.java   
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    this.deleteGlTexture();
    InputStream inputstream = null;

    try
    {
        IResource iresource = resourceManager.getResource(this.textureLocation);
        inputstream = iresource.getInputStream();
        BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                logger.warn((String)("Failed reading metadata of: " + this.textureLocation), (Throwable)runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:Backmemed    文件:SimpleShaderTexture.java   
private TextureMetadataSection loadTextureMetadataSection()
{
    String s = this.texturePath + ".mcmeta";
    String s1 = "texture";
    InputStream inputstream = Shaders.getShaderPackResourceStream(s);

    if (inputstream != null)
    {
        MetadataSerializer metadataserializer = METADATA_SERIALIZER;
        BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream));
        TextureMetadataSection texturemetadatasection1;

        try
        {
            JsonObject jsonobject = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject();
            TextureMetadataSection texturemetadatasection = (TextureMetadataSection)metadataserializer.parseMetadataSection(s1, jsonobject);

            if (texturemetadatasection == null)
            {
                return new TextureMetadataSection(false, false);
            }

            texturemetadatasection1 = texturemetadatasection;
        }
        catch (RuntimeException runtimeexception)
        {
            SMCLog.warning("Error reading metadata: " + s);
            SMCLog.warning("" + runtimeexception.getClass().getName() + ": " + runtimeexception.getMessage());
            return new TextureMetadataSection(false, false);
        }
        finally
        {
            IOUtils.closeQuietly((Reader)bufferedreader);
            IOUtils.closeQuietly(inputstream);
        }

        return texturemetadatasection1;
    }
    else
    {
        return new TextureMetadataSection(false, false);
    }
}
项目:Backmemed    文件:SimpleTexture.java   
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    this.deleteGlTexture();
    IResource iresource = null;

    try
    {
        iresource = resourceManager.getResource(this.textureLocation);
        BufferedImage bufferedimage = TextureUtil.readBufferedImage(iresource.getInputStream());
        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                LOG.warn("Failed reading metadata of: {}", new Object[] {this.textureLocation, runtimeexception});
            }
        }

        if (Config.isShaders())
        {
            ShadersTex.loadSimpleTexture(this.getGlTextureId(), bufferedimage, flag, flag1, resourceManager, this.textureLocation, this.getMultiTexID());
        }
        else
        {
            TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
        }
    }
    finally
    {
        IOUtils.closeQuietly((Closeable)iresource);
    }
}
项目:ExtraUtilities    文件:TextureComprBlock.java   
public boolean load(final IResourceManager manager, final ResourceLocation location) {
    final int mp = Minecraft.getMinecraft().gameSettings.mipmapLevels;
    try {
        final IResource iresource = manager.getResource(location);
        final BufferedImage[] abufferedimage = new BufferedImage[1 + Minecraft.getMinecraft().gameSettings.mipmapLevels];
        abufferedimage[0] = ImageIO.read(iresource.getInputStream());
        final TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");
        final AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)iresource.getMetadata("animation");
        this.loadSprite(abufferedimage, animationmetadatasection, Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0f);
    }
    catch (IOException e) {
        try {
            final IResource iresource2 = manager.getResource(this.textureLocation);
            final BufferedImage[] abufferedimage2 = new BufferedImage[1 + Minecraft.getMinecraft().gameSettings.mipmapLevels];
            abufferedimage2[0] = ImageIO.read(iresource2.getInputStream());
            final TextureMetadataSection texturemetadatasection2 = (TextureMetadataSection)iresource2.getMetadata("texture");
            final AnimationMetadataSection animationmetadatasection2 = (AnimationMetadataSection)iresource2.getMetadata("animation");
            this.loadSprite(abufferedimage2, animationmetadatasection2, Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0f);
        }
        catch (IOException e2) {
            e.printStackTrace();
            return true;
        }
        final float nh = this.n / 8.5f;
        final float br = 1.0f - nh;
        for (int j = 0; j < this.framesTextureData.size(); ++j) {
            final int[] image = new int[((int[][])this.framesTextureData.get(j))[0].length];
            for (int i = 0; i < image.length; ++i) {
                final int x = i % this.width;
                final int y = i / this.height;
                final int l = ((int[][])this.framesTextureData.get(j))[0][i];
                float r = (-l >> 16 & 0xFF) / 255.0f;
                float g = (-l >> 8 & 0xFF) / 255.0f;
                float b = (-l & 0xFF) / 255.0f;
                final float dx = 2 * x / (this.width - 1) - 1.0f;
                final float dy = 2 * y / (this.height - 1) - 1.0f;
                float db = Math.max(Math.abs(dx), Math.abs(dy));
                db = Math.max(db, (float)Math.sqrt(dx * dx + dy * dy) / 1.4f);
                float d = 1.0f - db + 1.0f - nh;
                final float rb = 1.0f - (2 + this.n) / 32.0f;
                float k = 1.0f;
                if (db > rb) {
                    k = 0.7f + 0.1f * (db - rb) / (1.0f - rb);
                }
                d *= k * k;
                if (d > 1.0f) {
                    d = 1.0f;
                }
                else if (d < 0.0f) {
                    d = 0.0f;
                }
                r = 1.0f - (1.0f - r) * br * d;
                g = 1.0f - (1.0f - g) * br * d;
                b = 1.0f - (1.0f - b) * br * d;
                image[i] = -((int)(r * 255.0f) << 16 | (int)(g * 255.0f) << 8 | (int)(b * 255.0f));
            }
            final int[][] aint = new int[1 + mp][];
            aint[0] = image;
            this.framesTextureData.set(j, aint);
        }
    }
    return false;
}
项目:Resilience-Client-Source    文件:SimpleTexture.java   
public void loadTexture(IResourceManager par1ResourceManager) throws IOException
{
    this.func_147631_c();
    InputStream var2 = null;

    try
    {
        IResource var3 = par1ResourceManager.getResource(this.textureLocation);
        var2 = var3.getInputStream();
        BufferedImage var4 = ImageIO.read(var2);
        boolean var5 = false;
        boolean var6 = false;

        if (var3.hasMetadata())
        {
            try
            {
                TextureMetadataSection var7 = (TextureMetadataSection)var3.getMetadata("texture");

                if (var7 != null)
                {
                    var5 = var7.getTextureBlur();
                    var6 = var7.getTextureClamp();
                }
            }
            catch (RuntimeException var11)
            {
                logger.warn("Failed reading metadata of: " + this.textureLocation, var11);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), var4, var5, var6);
    }
    finally
    {
        if (var2 != null)
        {
            var2.close();
        }
    }
}
项目:Gadomancy    文件:GolemGuiTexture.java   
@Override
public void loadTexture(IResourceManager resourceManager) throws IOException {
    this.deleteGlTexture();
    InputStream inputstream = null;

    try
    {
        IResource iresource = resourceManager.getResource(this.textureLocation);
        inputstream = iresource.getInputStream();
        BufferedImage bufferedimage = manipulateImage(resourceManager, ImageIO.read(inputstream));

        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                LOGGER.warn("Failed reading metadata of: " + this.textureLocation, runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:Cauldron    文件:SimpleTexture.java   
public void loadTexture(IResourceManager p_110551_1_) throws IOException
{
    this.deleteGlTexture();
    InputStream inputstream = null;

    try
    {
        IResource iresource = p_110551_1_.getResource(this.textureLocation);
        inputstream = iresource.getInputStream();
        BufferedImage bufferedimage = ImageIO.read(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                logger.warn("Failed reading metadata of: " + this.textureLocation, runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:Cauldron    文件:SimpleTexture.java   
public void loadTexture(IResourceManager p_110551_1_) throws IOException
{
    this.deleteGlTexture();
    InputStream inputstream = null;

    try
    {
        IResource iresource = p_110551_1_.getResource(this.textureLocation);
        inputstream = iresource.getInputStream();
        BufferedImage bufferedimage = ImageIO.read(inputstream);
        boolean flag = false;
        boolean flag1 = false;

        if (iresource.hasMetadata())
        {
            try
            {
                TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");

                if (texturemetadatasection != null)
                {
                    flag = texturemetadatasection.getTextureBlur();
                    flag1 = texturemetadatasection.getTextureClamp();
                }
            }
            catch (RuntimeException runtimeexception)
            {
                logger.warn("Failed reading metadata of: " + this.textureLocation, runtimeexception);
            }
        }

        TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
    }
    finally
    {
        if (inputstream != null)
        {
            inputstream.close();
        }
    }
}
项目:RuneCraftery    文件:TextureMetadataSectionSerializer.java   
public TextureMetadataSection func_110494_a(JsonElement p_110494_1_, Type p_110494_2_, JsonDeserializationContext p_110494_3_) {
   JsonObject var4 = p_110494_1_.getAsJsonObject();
   boolean var5 = this.func_110484_a(var4.get("blur"), "blur", Boolean.valueOf(false));
   boolean var6 = this.func_110484_a(var4.get("clamp"), "clamp", Boolean.valueOf(false));
   return new TextureMetadataSection(var5, var6);
}