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

Method getFloat

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

Gets the float 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_151220_0_, String p_151220_1_)

Source from the content-addressed store, hash-verified

139 * field if an error message needs to be thrown.
140 */
141 public static float getFloat(JsonElement p_151220_0_, String p_151220_1_)
142 {
143 if (p_151220_0_.isJsonPrimitive() && p_151220_0_.getAsJsonPrimitive().isNumber())
144 {
145 return p_151220_0_.getAsFloat();
146 }
147 else
148 {
149 throw new JsonSyntaxException("Expected " + p_151220_1_ + " to be a Float, was " + toString(p_151220_0_));
150 }
151 }
152
153 /**
154 * Gets the float value of the field on the JsonObject with the given name.

Callers 10

deserializeMethod · 0.95
parseUVMethod · 0.95
parseAngleMethod · 0.95
parsePositionMethod · 0.95
parseVector3fMethod · 0.95
parseUniformMethod · 0.95
initUniformMethod · 0.95
deserializeMethod · 0.95
deserializeMethod · 0.95
readNBTMethod · 0.45

Calls 3

toStringMethod · 0.95
isJsonPrimitiveMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected