Gets the given JsonElement as a JsonObject. Expects the second parameter to be the name of the element's field if an error message needs to be thrown.
(JsonElement p_151210_0_, String p_151210_1_)
| 219 | * if an error message needs to be thrown. |
| 220 | */ |
| 221 | public static JsonObject getJsonObject(JsonElement p_151210_0_, String p_151210_1_) |
| 222 | { |
| 223 | if (p_151210_0_.isJsonObject()) |
| 224 | { |
| 225 | return p_151210_0_.getAsJsonObject(); |
| 226 | } |
| 227 | else |
| 228 | { |
| 229 | throw new JsonSyntaxException("Expected " + p_151210_1_ + " to be a JsonObject, was " + toString(p_151210_0_)); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | public static JsonObject getJsonObject(JsonObject base, String key) |
| 234 | { |
no test coverage detected