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

Method getString

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

Gets the string 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_151206_0_, String p_151206_1_)

Source from the content-addressed store, hash-verified

59 * field if an error message needs to be thrown.
60 */
61 public static String getString(JsonElement p_151206_0_, String p_151206_1_)
62 {
63 if (p_151206_0_.isJsonPrimitive())
64 {
65 return p_151206_0_.getAsString();
66 }
67 else
68 {
69 throw new JsonSyntaxException("Expected " + p_151206_1_ + " to be a string, was " + toString(p_151206_0_));
70 }
71 }
72
73 /**
74 * Gets the string value of the field on the JsonObject with the given name.

Callers 15

ResourceIndexMethod · 0.95
deserializeMethod · 0.95
parseModelMethod · 0.95
getParentMethod · 0.95
parseAxisMethod · 0.95
parseTextureMethod · 0.95
parseCullFaceMethod · 0.95
ShaderManagerMethod · 0.95
parseSamplerMethod · 0.95
parseUniformMethod · 0.95
initTargetMethod · 0.95
parsePassMethod · 0.95

Calls 3

toStringMethod · 0.95
isJsonPrimitiveMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected