From 8656d6bfb973515afce3ef7534c697ee23c7be4c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 26 Feb 2024 21:09:57 -0500 Subject: [PATCH] New branch more progress --- src/engine/objects/ItemTemplate.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index bc99cece..e9c5c0ec 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -156,6 +156,8 @@ public class ItemTemplate { item_defense_rating = ((Long) jsonObject.get("item_defense_rating")).intValue(); } + // Fields only present for WEAPON + if (item_type.equals(Enum.ItemType.WEAPON)) { JSONObject item_weapon = (JSONObject) jsonObject.get("item_weapon"); @@ -167,6 +169,8 @@ public class ItemTemplate { JSONArray weapon_damage = (JSONArray) item_weapon.get("weapon_damage"); + // Need a pojo for this or a PAIR<> + for (Object o : weapon_damage) { JSONObject damage_entry = (JSONObject) o; item_weapon_damage_type = Enum.SourceType.valueOf(((String) damage_entry.get("damage_type")).toUpperCase());