本文整理汇总了Java中net.minecraft.client.util.JsonException.func_151379_a方法的典型用法代码示例。如果您正苦于以下问题:Java JsonException.func_151379_a方法的具体用法?Java JsonException.func_151379_a怎么用?Java JsonException.func_151379_a使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.util.JsonException
的用法示例。
在下文中一共展示了JsonException.func_151379_a方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseUniform
import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
private void parseUniform(JsonElement p_147987_1_) throws JsonException
{
JsonObject jsonobject = JsonUtils.getJsonObject(p_147987_1_, "uniform");
String s = JsonUtils.getString(jsonobject, "name");
int i = ShaderUniform.parseType(JsonUtils.getString(jsonobject, "type"));
int j = JsonUtils.getInt(jsonobject, "count");
float[] afloat = new float[Math.max(j, 16)];
JsonArray jsonarray = JsonUtils.getJsonArray(jsonobject, "values");
if (jsonarray.size() != j && jsonarray.size() > 1)
{
throw new JsonException("Invalid amount of values specified (expected " + j + ", found " + jsonarray.size() + ")");
}
else
{
int k = 0;
for (JsonElement jsonelement : jsonarray)
{
try
{
afloat[k] = JsonUtils.getFloat(jsonelement, "value");
}
catch (Exception exception)
{
JsonException jsonexception = JsonException.func_151379_a(exception);
jsonexception.func_151380_a("values[" + k + "]");
throw jsonexception;
}
++k;
}
if (j > 1 && jsonarray.size() == 1)
{
while (k < j)
{
afloat[k] = afloat[0];
++k;
}
}
int l = j > 1 && j <= 4 && i < 8 ? j - 1 : 0;
ShaderUniform shaderuniform = new ShaderUniform(s, i + l, j, this);
if (i <= 3)
{
shaderuniform.set((int)afloat[0], (int)afloat[1], (int)afloat[2], (int)afloat[3]);
}
else if (i <= 7)
{
shaderuniform.func_148092_b(afloat[0], afloat[1], afloat[2], afloat[3]);
}
else
{
shaderuniform.set(afloat);
}
this.shaderUniforms.add(shaderuniform);
}
}
示例2: 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);
}
}
示例3: initUniform
import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
private void initUniform(JsonElement p_148028_1_) throws JsonException
{
JsonObject jsonobject = JsonUtils.getJsonObject(p_148028_1_, "uniform");
String s = JsonUtils.getString(jsonobject, "name");
ShaderUniform shaderuniform = ((Shader)this.listShaders.get(this.listShaders.size() - 1)).getShaderManager().getShaderUniform(s);
if (shaderuniform == null)
{
throw new JsonException("Uniform \'" + s + "\' does not exist");
}
else
{
float[] afloat = new float[4];
int i = 0;
for (JsonElement jsonelement : JsonUtils.getJsonArray(jsonobject, "values"))
{
try
{
afloat[i] = JsonUtils.getFloat(jsonelement, "value");
}
catch (Exception exception)
{
JsonException jsonexception = JsonException.func_151379_a(exception);
jsonexception.func_151380_a("values[" + i + "]");
throw jsonexception;
}
++i;
}
switch (i)
{
case 0:
default:
break;
case 1:
shaderuniform.set(afloat[0]);
break;
case 2:
shaderuniform.set(afloat[0], afloat[1]);
break;
case 3:
shaderuniform.set(afloat[0], afloat[1], afloat[2]);
break;
case 4:
shaderuniform.set(afloat[0], afloat[1], afloat[2], afloat[3]);
}
}
}
示例4: func_147987_b
import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
private void func_147987_b(JsonElement p_147987_1_) throws JsonException
{
JsonObject var2 = JsonUtils.getJsonElementAsJsonObject(p_147987_1_, "uniform");
String var3 = JsonUtils.getJsonObjectStringFieldValue(var2, "name");
int var4 = ShaderUniform.func_148085_a(JsonUtils.getJsonObjectStringFieldValue(var2, "type"));
int var5 = JsonUtils.getJsonObjectIntegerFieldValue(var2, "count");
float[] var6 = new float[Math.max(var5, 16)];
JsonArray var7 = JsonUtils.getJsonObjectJsonArrayField(var2, "values");
if (var7.size() != var5 && var7.size() > 1)
{
throw new JsonException("Invalid amount of values specified (expected " + var5 + ", found " + var7.size() + ")");
}
else
{
int var8 = 0;
for (Iterator var9 = var7.iterator(); var9.hasNext(); ++var8)
{
JsonElement var10 = (JsonElement)var9.next();
try
{
var6[var8] = JsonUtils.getJsonElementFloatValue(var10, "value");
}
catch (Exception var13)
{
JsonException var12 = JsonException.func_151379_a(var13);
var12.func_151380_a("values[" + var8 + "]");
throw var12;
}
}
if (var5 > 1 && var7.size() == 1)
{
while (var8 < var5)
{
var6[var8] = var6[0];
++var8;
}
}
int var14 = var5 > 1 && var5 <= 4 && var4 < 8 ? var5 - 1 : 0;
ShaderUniform var15 = new ShaderUniform(var3, var4 + var14, var5, this);
if (var4 <= 3)
{
var15.func_148083_a((int)var6[0], (int)var6[1], (int)var6[2], (int)var6[3]);
}
else if (var4 <= 7)
{
var15.func_148092_b(var6[0], var6[1], var6[2], var6[3]);
}
else
{
var15.func_148097_a(var6);
}
this.field_148011_i.add(var15);
}
}
示例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);
}
}
示例6: initPass
import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
private void initPass(JsonElement p_148019_1_) throws JsonException
{
JsonObject var2 = JsonUtils.getJsonElementAsJsonObject(p_148019_1_, "pass");
String var3 = JsonUtils.getJsonObjectStringFieldValue(var2, "name");
String var4 = JsonUtils.getJsonObjectStringFieldValue(var2, "intarget");
String var5 = JsonUtils.getJsonObjectStringFieldValue(var2, "outtarget");
Framebuffer var6 = this.getFramebuffer(var4);
Framebuffer var7 = this.getFramebuffer(var5);
if (var6 == null)
{
throw new JsonException("Input target \'" + var4 + "\' does not exist");
}
else if (var7 == null)
{
throw new JsonException("Output target \'" + var5 + "\' does not exist");
}
else
{
Shader var8 = this.addShader(var3, var6, var7);
JsonArray var9 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(var2, "auxtargets", (JsonArray)null);
if (var9 != null)
{
int var10 = 0;
for (Iterator var11 = var9.iterator(); var11.hasNext(); ++var10)
{
JsonElement var12 = (JsonElement)var11.next();
try
{
JsonObject var13 = JsonUtils.getJsonElementAsJsonObject(var12, "auxtarget");
String var24 = JsonUtils.getJsonObjectStringFieldValue(var13, "name");
String var15 = JsonUtils.getJsonObjectStringFieldValue(var13, "id");
Framebuffer var16 = this.getFramebuffer(var15);
if (var16 == null)
{
throw new JsonException("Render target \'" + var15 + "\' does not exist");
}
var8.addAuxFramebuffer(var24, var16, var16.framebufferTextureWidth, var16.framebufferTextureHeight);
}
catch (Exception var18)
{
JsonException var14 = JsonException.func_151379_a(var18);
var14.func_151380_a("auxtargets[" + var10 + "]");
throw var14;
}
}
}
JsonArray var20 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(var2, "uniforms", (JsonArray)null);
if (var20 != null)
{
int var19 = 0;
for (Iterator var21 = var20.iterator(); var21.hasNext(); ++var19)
{
JsonElement var22 = (JsonElement)var21.next();
try
{
this.initUniform(var22);
}
catch (Exception var17)
{
JsonException var23 = JsonException.func_151379_a(var17);
var23.func_151380_a("uniforms[" + var19 + "]");
throw var23;
}
}
}
}
}
示例7: initUniform
import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
private void initUniform(JsonElement p_148028_1_) throws JsonException
{
JsonObject var2 = JsonUtils.getJsonElementAsJsonObject(p_148028_1_, "uniform");
String var3 = JsonUtils.getJsonObjectStringFieldValue(var2, "name");
ShaderUniform var4 = ((Shader)this.listShaders.get(this.listShaders.size() - 1)).getShaderManager().func_147991_a(var3);
if (var4 == null)
{
throw new JsonException("Uniform \'" + var3 + "\' does not exist");
}
else
{
float[] var5 = new float[4];
int var6 = 0;
JsonArray var7 = JsonUtils.getJsonObjectJsonArrayField(var2, "values");
for (Iterator var8 = var7.iterator(); var8.hasNext(); ++var6)
{
JsonElement var9 = (JsonElement)var8.next();
try
{
var5[var6] = JsonUtils.getJsonElementFloatValue(var9, "value");
}
catch (Exception var12)
{
JsonException var11 = JsonException.func_151379_a(var12);
var11.func_151380_a("values[" + var6 + "]");
throw var11;
}
}
switch (var6)
{
case 0:
default:
break;
case 1:
var4.func_148090_a(var5[0]);
break;
case 2:
var4.func_148087_a(var5[0], var5[1]);
break;
case 3:
var4.func_148095_a(var5[0], var5[1], var5[2]);
break;
case 4:
var4.func_148081_a(var5[0], var5[1], var5[2], var5[3]);
}
}
}
示例8: func_147987_b
import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
private void func_147987_b(JsonElement p_147987_1_) throws JsonException
{
JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_147987_1_, "uniform");
String s = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "name");
int i = ShaderUniform.func_148085_a(JsonUtils.getJsonObjectStringFieldValue(jsonobject, "type"));
int j = JsonUtils.getJsonObjectIntegerFieldValue(jsonobject, "count");
float[] afloat = new float[Math.max(j, 16)];
JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayField(jsonobject, "values");
if (jsonarray.size() != j && jsonarray.size() > 1)
{
throw new JsonException("Invalid amount of values specified (expected " + j + ", found " + jsonarray.size() + ")");
}
else
{
int k = 0;
for (Iterator iterator = jsonarray.iterator(); iterator.hasNext(); ++k)
{
JsonElement jsonelement1 = (JsonElement)iterator.next();
try
{
afloat[k] = JsonUtils.getJsonElementFloatValue(jsonelement1, "value");
}
catch (Exception exception)
{
JsonException jsonexception = JsonException.func_151379_a(exception);
jsonexception.func_151380_a("values[" + k + "]");
throw jsonexception;
}
}
if (j > 1 && jsonarray.size() == 1)
{
while (k < j)
{
afloat[k] = afloat[0];
++k;
}
}
int l = j > 1 && j <= 4 && i < 8 ? j - 1 : 0;
ShaderUniform shaderuniform = new ShaderUniform(s, i + l, j, this);
if (i <= 3)
{
shaderuniform.func_148083_a((int)afloat[0], (int)afloat[1], (int)afloat[2], (int)afloat[3]);
}
else if (i <= 7)
{
shaderuniform.func_148092_b(afloat[0], afloat[1], afloat[2], afloat[3]);
}
else
{
shaderuniform.func_148097_a(afloat);
}
this.field_148011_i.add(shaderuniform);
}
}
示例9: 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);
}
}
示例10: initUniform
import net.minecraft.client.util.JsonException; //导入方法依赖的package包/类
private void initUniform(JsonElement p_148028_1_) throws JsonException
{
JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_148028_1_, "uniform");
String s = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "name");
ShaderUniform shaderuniform = ((Shader)this.listShaders.get(this.listShaders.size() - 1)).getShaderManager().func_147991_a(s);
if (shaderuniform == null)
{
throw new JsonException("Uniform \'" + s + "\' does not exist");
}
else
{
float[] afloat = new float[4];
int i = 0;
JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayField(jsonobject, "values");
for (Iterator iterator = jsonarray.iterator(); iterator.hasNext(); ++i)
{
JsonElement jsonelement1 = (JsonElement)iterator.next();
try
{
afloat[i] = JsonUtils.getJsonElementFloatValue(jsonelement1, "value");
}
catch (Exception exception)
{
JsonException jsonexception = JsonException.func_151379_a(exception);
jsonexception.func_151380_a("values[" + i + "]");
throw jsonexception;
}
}
switch (i)
{
case 0:
default:
break;
case 1:
shaderuniform.func_148090_a(afloat[0]);
break;
case 2:
shaderuniform.func_148087_a(afloat[0], afloat[1]);
break;
case 3:
shaderuniform.func_148095_a(afloat[0], afloat[1], afloat[2]);
break;
case 4:
shaderuniform.func_148081_a(afloat[0], afloat[1], afloat[2], afloat[3]);
}
}
}