forked from MagicBane/Server
Fleshing out constructor
This commit is contained in:
@@ -13,7 +13,6 @@ import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
@@ -64,9 +63,13 @@ public class ItemTemplate {
|
||||
combat_attack_resist.put((String) key, resist);
|
||||
}
|
||||
|
||||
JSONArray combat_json = (JSONArray) jsonObject.get("combat_powers");
|
||||
combatPowers = (ArrayList) Arrays.asList(combat_json.toArray());
|
||||
// Reading arraylist of ints
|
||||
|
||||
JSONArray combat_json = (JSONArray) jsonObject.get("combat_powers");
|
||||
|
||||
if (combat_json.isEmpty() == false)
|
||||
for (Object o : combat_json)
|
||||
combatPowers.add(o);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user