Browse Source

Minor update to keyset() usages

combat-2
MagicBot 7 months ago
parent
commit
46f35f0b10
  1. 12
      src/engine/objects/ItemTemplate.java

12
src/engine/objects/ItemTemplate.java

@ -181,8 +181,7 @@ public class ItemTemplate {
JSONObject obj_sparse_json = jsonObject.getJSONObject("obj_sparse_data"); JSONObject obj_sparse_json = jsonObject.getJSONObject("obj_sparse_data");
for (Object key : obj_sparse_json.keySet()) { for (String sparseType : obj_sparse_json.keySet()) {
String sparseType = key.toString();
Object sparseValue = obj_sparse_json.get(sparseType); Object sparseValue = obj_sparse_json.get(sparseType);
obj_sparse_data.put(sparseType, sparseValue.toString()); obj_sparse_data.put(sparseType, sparseValue.toString());
} }
@ -202,9 +201,9 @@ public class ItemTemplate {
JSONObject resist_json = jsonObject.getJSONObject("combat_attack_resist"); JSONObject resist_json = jsonObject.getJSONObject("combat_attack_resist");
for (String key : resist_json.keySet()) { for (String resistType : resist_json.keySet()) {
float resist = resist_json.getFloat(key); float resistValue = resist_json.getFloat(resistType);
combat_attack_resist.put(key, resist); combat_attack_resist.put(resistType, resistValue);
} }
// Parsing an enum // Parsing an enum
@ -554,8 +553,7 @@ public class ItemTemplate {
JSONObject rune_sparse_json = jsonObject.getJSONObject("rune_sparse_data"); JSONObject rune_sparse_json = jsonObject.getJSONObject("rune_sparse_data");
for (Object key : rune_sparse_json.keySet()) { for (String sparseType : rune_sparse_json.keySet()) {
String sparseType = key.toString();
Object sparseValue = rune_sparse_json.get(sparseType); Object sparseValue = rune_sparse_json.get(sparseType);
rune_sparse_data.put(sparseType, sparseValue.toString()); rune_sparse_data.put(sparseType, sparseValue.toString());
} }

Loading…
Cancel
Save