MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / getInt

Method getInt

src/main/java/net/minecraft/util/JsonUtils.java:181–191  ·  view source on GitHub ↗

Gets the integer value of the given JsonElement. Expects the second parameter to be the name of the element's field if an error message needs to be thrown.

(JsonElement p_151215_0_, String p_151215_1_)

Source from the content-addressed store, hash-verified

179 * field if an error message needs to be thrown.
180 */
181 public static int getInt(JsonElement p_151215_0_, String p_151215_1_)
182 {
183 if (p_151215_0_.isJsonPrimitive() && p_151215_0_.getAsJsonPrimitive().isNumber())
184 {
185 return p_151215_0_.getAsInt();
186 }
187 else
188 {
189 throw new JsonSyntaxException("Expected " + p_151215_1_ + " to be a Int, was " + toString(p_151215_0_));
190 }
191 }
192
193 /**
194 * Gets the integer value of the field on the JsonObject with the given name.

Callers 14

deserializeMethod · 0.95
parseAnimationFrameMethod · 0.95
deserializeMethod · 0.95
parseRotationMethod · 0.95
parseWeightMethod · 0.95
parseRotationMethod · 0.95
parseTintIndexMethod · 0.95
parseUniformMethod · 0.95
initTargetMethod · 0.95
parsePassMethod · 0.95
deserializeMethod · 0.95
deserializeMethod · 0.95

Calls 3

toStringMethod · 0.95
isJsonPrimitiveMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected