當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。