From b0542a5bc37f8c2e27091b808481122c0abf4687 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 18 Feb 2024 12:35:55 -0500 Subject: [PATCH] Fleshing out constructor --- src/engine/objects/ItemTemplate.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 84f84568..55f30988 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -24,6 +24,8 @@ public class ItemTemplate { public String obj_name = ""; public Vector3fImmutable obj_scale = new Vector3fImmutable(); public int obj_render_object; + public float combat_health_current; + public float combat_health_full; public HashMap combat_attack_resist = new HashMap<>(); public ItemTemplate(JSONObject jsonObject) { @@ -42,6 +44,11 @@ public class ItemTemplate { obj_render_object = ((Long) jsonObject.get("obj_render_object")).intValue(); + // Reading float values + + combat_health_current = ((Double) jsonObject.get("combat_health_current")).floatValue(); + combat_health_full = ((Double) jsonObject.get("combat_health_full")).floatValue(); + // Reading a hashmap of floats JSONObject resist_json = (JSONObject) jsonObject.get("combat_attack_resist");