From 11e6b793d56a35b3fabc8f83993b05d38445e21f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 18 Feb 2024 15:15:19 -0500 Subject: [PATCH] More constructor work. --- src/engine/objects/ItemTemplate.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index ab20b087..8391e4be 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -12,6 +12,7 @@ import engine.Enum; import engine.math.Vector3fImmutable; import org.json.simple.JSONArray; import org.json.simple.JSONObject; +import org.pmw.tinylog.Logger; import java.util.EnumSet; import java.util.HashMap; @@ -78,7 +79,11 @@ public class ItemTemplate { // Parsing an enum - item_type = Enum.ItemType.valueOf((String) jsonObject.get("item_type")); + try { + item_type = Enum.ItemType.valueOf((String) jsonObject.get("item_type")); + } catch (Exception e) { + Logger.error((String) jsonObject.get("item_type")); + } item_eq_slots_value = ((Long) jsonObject.get("item_eq_slots_value")).intValue(); item_eq_slots_type = (boolean) jsonObject.get("item_eq_slots_type");