Parse offering info.

This commit is contained in:
2024-03-07 20:39:31 -05:00
parent 8e85136dc5
commit 5476d238fa
+6 -6
View File
@@ -177,13 +177,13 @@ public class ItemTemplate {
// Reading offering data // Reading offering data
JSONObject item_offering_info = (JSONObject) jsonObject.get("item_offering_info"); JSONArray offering_data = (JSONArray) jsonObject.get("item_offering_info");
for (Object key : item_offering_info.keySet()) { for (Object entry : offering_data) {
String shrineType = (String) key; JSONObject offering_entry = (JSONObject) entry;
shrineType = shrineType.replaceAll("-", ""); // For half-giant String offering_type = ((String) offering_entry.get("offering_type")).replaceAll("-", "");
int value = ((Double) item_offering_info.get(key)).intValue(); int offering_value = ((Double) offering_entry.get("offering_value")).intValue();
item_offering_info.put(shrineType, value); item_offering_info.put(offering_type, offering_value);
} }
// Fields only present for ARMOR // Fields only present for ARMOR