当前位置: 首页>>代码示例>>Java>>正文


Java IResource.hasMetadata方法代码示例

本文整理汇总了Java中net.minecraft.client.resources.IResource.hasMetadata方法的典型用法代码示例。如果您正苦于以下问题:Java IResource.hasMetadata方法的具体用法?Java IResource.hasMetadata怎么用?Java IResource.hasMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.resources.IResource的用法示例。


在下文中一共展示了IResource.hasMetadata方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadTexture

import net.minecraft.client.resources.IResource; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:38,代码来源:SimpleTexture.java

示例2: loadTexture

import net.minecraft.client.resources.IResource; //导入方法依赖的package包/类
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();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:42,代码来源:SimpleTexture.java

示例3: loadTexture

import net.minecraft.client.resources.IResource; //导入方法依赖的package包/类
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();
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:49,代码来源:SimpleTexture.java

示例4: loadTexture

import net.minecraft.client.resources.IResource; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:45,代码来源:SimpleTexture.java

示例5: loadTexture

import net.minecraft.client.resources.IResource; //导入方法依赖的package包/类
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();
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:42,代码来源:SimpleTexture.java

示例6: loadTexture

import net.minecraft.client.resources.IResource; //导入方法依赖的package包/类
@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();
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:43,代码来源:GolemGuiTexture.java

示例7: loadTexture

import net.minecraft.client.resources.IResource; //导入方法依赖的package包/类
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();
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:42,代码来源:SimpleTexture.java


注:本文中的net.minecraft.client.resources.IResource.hasMetadata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。