Browse Source

Parsing resource costs

combat-2
MagicBot 9 months ago
parent
commit
2cd3d028a9
  1. 2
      src/engine/objects/ItemTemplate.java

2
src/engine/objects/ItemTemplate.java

@ -353,7 +353,7 @@ public class ItemTemplate {
if (resource_costs.isEmpty() == false) if (resource_costs.isEmpty() == false)
for (Object o : resource_costs) { for (Object o : resource_costs) {
JSONObject resource_entry = (JSONObject) o; JSONObject resource_entry = (JSONObject) o;
Enum.ResourceType resource_type = Enum.ResourceType.valueOf((String) resource_entry.get("resource_type")); Enum.ResourceType resource_type = Enum.ResourceType.valueOf(((String) resource_entry.get("resource_type")).toUpperCase());
int resource_value = ((Long) resource_entry.get("resource_value")).intValue(); int resource_value = ((Long) resource_entry.get("resource_value")).intValue();
item_resource_cost.put(resource_type, resource_value); item_resource_cost.put(resource_type, resource_value);
} }

Loading…
Cancel
Save