Parsing grants

This commit is contained in:
2024-02-27 13:48:21 -05:00
parent 67e4011c65
commit e464f30445
+8 -6
View File
@@ -279,12 +279,14 @@ public class ItemTemplate {
}
JSONArray powerGrants = (JSONArray) jsonObject.get("item_power_grant");
for (Object o : powerGrants) {
JSONObject powerGrantEntry = (JSONObject) o;
String power_type = (String) powerGrantEntry.get("power_type");
int power_value = ((Long) powerGrantEntry.get("power_value")).intValue();
item_power_grant.put(power_type, power_value);
}
if (powerGrants.isEmpty() == false)
for (Object o : powerGrants) {
JSONObject powerGrantEntry = (JSONObject) o;
String power_type = (String) powerGrantEntry.get("power_type");
int power_value = ((Long) powerGrantEntry.get("power_value")).intValue();
item_power_grant.put(power_type, power_value);
}
} catch (Exception e) {