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


Java JsonException.func_151381_b方法代码示例

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


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

示例1: loadShader

import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
public static ShaderLoader loadShader(IResourceManager resourceManager, ShaderLoader.ShaderType type, String filename) throws IOException
{
    ShaderLoader shaderloader = (ShaderLoader)type.getLoadedShaders().get(filename);

    if (shaderloader == null)
    {
        ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + filename + type.getShaderExtension());
        BufferedInputStream bufferedinputstream = new BufferedInputStream(resourceManager.getResource(resourcelocation).getInputStream());
        byte[] abyte = toByteArray(bufferedinputstream);
        ByteBuffer bytebuffer = BufferUtils.createByteBuffer(abyte.length);
        bytebuffer.put(abyte);
        bytebuffer.position(0);
        int i = OpenGlHelper.glCreateShader(type.getShaderMode());
        OpenGlHelper.glShaderSource(i, bytebuffer);
        OpenGlHelper.glCompileShader(i);

        if (OpenGlHelper.glGetShaderi(i, OpenGlHelper.GL_COMPILE_STATUS) == 0)
        {
            String s = StringUtils.trim(OpenGlHelper.glGetShaderInfoLog(i, 32768));
            JsonException jsonexception = new JsonException("Couldn\'t compile " + type.getShaderName() + " program: " + s);
            jsonexception.func_151381_b(resourcelocation.getResourcePath());
            throw jsonexception;
        }

        shaderloader = new ShaderLoader(type, i, filename);
        type.getLoadedShaders().put(filename, shaderloader);
    }

    return shaderloader;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:31,代码来源:ShaderLoader.java

示例2: func_148057_a

import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
public static ShaderLoader func_148057_a(IResourceManager p_148057_0_, ShaderLoader.ShaderType p_148057_1_, String p_148057_2_) throws IOException
{
    ShaderLoader var3 = (ShaderLoader)p_148057_1_.func_148064_d().get(p_148057_2_);

    if (var3 == null)
    {
        ResourceLocation var4 = new ResourceLocation("shaders/program/" + p_148057_2_ + p_148057_1_.func_148063_b());
        BufferedInputStream var5 = new BufferedInputStream(p_148057_0_.getResource(var4).getInputStream());
        byte[] var6 = IOUtils.toByteArray(var5);
        ByteBuffer var7 = BufferUtils.createByteBuffer(var6.length);
        var7.put(var6);
        var7.position(0);
        int var8 = GL20.glCreateShader(p_148057_1_.func_148065_c());
        GL20.glShaderSource(var8, var7);
        GL20.glCompileShader(var8);

        if (GL20.glGetShaderi(var8, 35713) == 0)
        {
            String var9 = StringUtils.trim(GL20.glGetShaderInfoLog(var8, 32768));
            JsonException var10 = new JsonException("Couldn\'t compile " + p_148057_1_.func_148062_a() + " program: " + var9);
            var10.func_151381_b(var4.getResourcePath());
            throw var10;
        }

        var3 = new ShaderLoader(p_148057_1_, var8, p_148057_2_);
        p_148057_1_.func_148064_d().put(p_148057_2_, var3);
    }

    return var3;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:31,代码来源:ShaderLoader.java

示例3: func_148057_a

import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
public static ShaderLoader func_148057_a(IResourceManager p_148057_0_, ShaderLoader.ShaderType p_148057_1_, String p_148057_2_) throws IOException
{
    ShaderLoader shaderloader = (ShaderLoader)p_148057_1_.func_148064_d().get(p_148057_2_);

    if (shaderloader == null)
    {
        ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + p_148057_2_ + p_148057_1_.func_148063_b());
        BufferedInputStream bufferedinputstream = new BufferedInputStream(p_148057_0_.getResource(resourcelocation).getInputStream());
        byte[] abyte = IOUtils.toByteArray(bufferedinputstream);
        ByteBuffer bytebuffer = BufferUtils.createByteBuffer(abyte.length);
        bytebuffer.put(abyte);
        bytebuffer.position(0);
        int i = OpenGlHelper.func_153195_b(p_148057_1_.func_148065_c());
        OpenGlHelper.func_153169_a(i, bytebuffer);
        OpenGlHelper.func_153170_c(i);

        if (OpenGlHelper.func_153157_c(i, OpenGlHelper.field_153208_p) == 0)
        {
            String s1 = StringUtils.trim(OpenGlHelper.func_153158_d(i, 32768));
            JsonException jsonexception = new JsonException("Couldn\'t compile " + p_148057_1_.func_148062_a() + " program: " + s1);
            jsonexception.func_151381_b(resourcelocation.getResourcePath());
            throw jsonexception;
        }

        shaderloader = new ShaderLoader(p_148057_1_, i, p_148057_2_);
        p_148057_1_.func_148064_d().put(p_148057_2_, shaderloader);
    }

    return shaderloader;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:31,代码来源:ShaderLoader.java

示例4: parseGroup

import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
public void parseGroup(TextureManager p_152765_1_, ResourceLocation p_152765_2_) throws JsonException, IOException, JsonSyntaxException
{
    JsonParser jsonparser = new JsonParser();
    InputStream inputstream = null;

    try
    {
        IResource iresource = this.resourceManager.getResource(p_152765_2_);
        inputstream = iresource.getInputStream();
        JsonObject jsonobject = jsonparser.parse(IOUtils.toString(inputstream, Charsets.UTF_8)).getAsJsonObject();

        if (JsonUtils.isJsonArray(jsonobject, "targets"))
        {
            JsonArray jsonarray = jsonobject.getAsJsonArray("targets");
            int i = 0;

            for (JsonElement jsonelement : jsonarray)
            {
                try
                {
                    this.initTarget(jsonelement);
                }
                catch (Exception exception1)
                {
                    JsonException jsonexception1 = JsonException.func_151379_a(exception1);
                    jsonexception1.func_151380_a("targets[" + i + "]");
                    throw jsonexception1;
                }

                ++i;
            }
        }

        if (JsonUtils.isJsonArray(jsonobject, "passes"))
        {
            JsonArray jsonarray1 = jsonobject.getAsJsonArray("passes");
            int j = 0;

            for (JsonElement jsonelement1 : jsonarray1)
            {
                try
                {
                    this.parsePass(p_152765_1_, jsonelement1);
                }
                catch (Exception exception)
                {
                    JsonException jsonexception2 = JsonException.func_151379_a(exception);
                    jsonexception2.func_151380_a("passes[" + j + "]");
                    throw jsonexception2;
                }

                ++j;
            }
        }
    }
    catch (Exception exception2)
    {
        JsonException jsonexception = JsonException.func_151379_a(exception2);
        jsonexception.func_151381_b(p_152765_2_.getResourcePath());
        throw jsonexception;
    }
    finally
    {
        IOUtils.closeQuietly(inputstream);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:67,代码来源:ShaderGroup.java

示例5: initFromLocation

import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
public void initFromLocation(ResourceLocation p_148025_1_) throws JsonException
{
    JsonParser var2 = new JsonParser();
    InputStream var3 = null;

    try
    {
        IResource var4 = this.resourceManager.getResource(p_148025_1_);
        var3 = var4.getInputStream();
        JsonObject var21 = var2.parse(IOUtils.toString(var3, Charsets.UTF_8)).getAsJsonObject();
        JsonArray var6;
        int var7;
        Iterator var8;
        JsonElement var9;
        JsonException var11;

        if (JsonUtils.jsonObjectFieldTypeIsArray(var21, "targets"))
        {
            var6 = var21.getAsJsonArray("targets");
            var7 = 0;

            for (var8 = var6.iterator(); var8.hasNext(); ++var7)
            {
                var9 = (JsonElement)var8.next();

                try
                {
                    this.initTarget(var9);
                }
                catch (Exception var18)
                {
                    var11 = JsonException.func_151379_a(var18);
                    var11.func_151380_a("targets[" + var7 + "]");
                    throw var11;
                }
            }
        }

        if (JsonUtils.jsonObjectFieldTypeIsArray(var21, "passes"))
        {
            var6 = var21.getAsJsonArray("passes");
            var7 = 0;

            for (var8 = var6.iterator(); var8.hasNext(); ++var7)
            {
                var9 = (JsonElement)var8.next();

                try
                {
                    this.initPass(var9);
                }
                catch (Exception var17)
                {
                    var11 = JsonException.func_151379_a(var17);
                    var11.func_151380_a("passes[" + var7 + "]");
                    throw var11;
                }
            }
        }
    }
    catch (Exception var19)
    {
        JsonException var5 = JsonException.func_151379_a(var19);
        var5.func_151381_b(p_148025_1_.getResourcePath());
        throw var5;
    }
    finally
    {
        IOUtils.closeQuietly(var3);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:72,代码来源:ShaderGroup.java

示例6: func_152765_a

import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
public void func_152765_a(TextureManager p_152765_1_, ResourceLocation p_152765_2_) throws JsonException
{
    JsonParser jsonparser = new JsonParser();
    InputStream inputstream = null;

    try
    {
        IResource iresource = this.resourceManager.getResource(p_152765_2_);
        inputstream = iresource.getInputStream();
        JsonObject jsonobject = jsonparser.parse(IOUtils.toString(inputstream, Charsets.UTF_8)).getAsJsonObject();
        JsonArray jsonarray;
        int i;
        Iterator iterator;
        JsonElement jsonelement;
        JsonException jsonexception1;

        if (JsonUtils.jsonObjectFieldTypeIsArray(jsonobject, "targets"))
        {
            jsonarray = jsonobject.getAsJsonArray("targets");
            i = 0;

            for (iterator = jsonarray.iterator(); iterator.hasNext(); ++i)
            {
                jsonelement = (JsonElement)iterator.next();

                try
                {
                    this.initTarget(jsonelement);
                }
                catch (Exception exception1)
                {
                    jsonexception1 = JsonException.func_151379_a(exception1);
                    jsonexception1.func_151380_a("targets[" + i + "]");
                    throw jsonexception1;
                }
            }
        }

        if (JsonUtils.jsonObjectFieldTypeIsArray(jsonobject, "passes"))
        {
            jsonarray = jsonobject.getAsJsonArray("passes");
            i = 0;

            for (iterator = jsonarray.iterator(); iterator.hasNext(); ++i)
            {
                jsonelement = (JsonElement)iterator.next();

                try
                {
                    this.func_152764_a(p_152765_1_, jsonelement);
                }
                catch (Exception exception)
                {
                    jsonexception1 = JsonException.func_151379_a(exception);
                    jsonexception1.func_151380_a("passes[" + i + "]");
                    throw jsonexception1;
                }
            }
        }
    }
    catch (Exception exception2)
    {
        JsonException jsonexception = JsonException.func_151379_a(exception2);
        jsonexception.func_151381_b(p_152765_2_.getResourcePath());
        throw jsonexception;
    }
    finally
    {
        IOUtils.closeQuietly(inputstream);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:72,代码来源:ShaderGroup.java


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