From 4746a8c9cf474db9ef228a5f2daf2101bb33d2d1 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 2 Apr 2024 14:41:22 -0400 Subject: [PATCH] More parsing work. --- src/engine/objects/ItemTemplate.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 95e137a4..2713435f 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -410,9 +410,12 @@ public class ItemTemplate { JSONArray attr_adj_json = (JSONArray) jsonObject.get("rune_attr_adj"); - for (Object attributes : attr_adj_json) { - attributes.toString(); - + for (Object attributeEntry : attr_adj_json) { + JSONObject attribute = (JSONObject) attributeEntry; + String typeString = (String) attribute.get("attr_type"); + Enum.AttributeType attributeType = Enum.AttributeType.valueOf(typeString); + int attributeValue = ((Long) attribute.get("attr_value")).intValue(); + rune_attr_adj.put(attributeType, attributeValue); } }