forked from MagicBane/Server
Proper parsing of power grants
This commit is contained in:
@@ -356,13 +356,8 @@ public class ItemTemplate {
|
|||||||
|
|
||||||
for (Object grantArrayEntry : powerGrantsArray) {
|
for (Object grantArrayEntry : powerGrantsArray) {
|
||||||
JSONObject powerGrantEntry = (JSONObject) grantArrayEntry;
|
JSONObject powerGrantEntry = (JSONObject) grantArrayEntry;
|
||||||
JSONObject powerGrant = (JSONObject) powerGrantEntry.get("power_granted_powers");
|
JSONArray powerGrants = (JSONArray) powerGrantEntry.get("power_granted_powers");
|
||||||
|
|
||||||
for (Object key : powerGrant.keySet()) {
|
|
||||||
String powerString = (String) key;
|
|
||||||
int powerLevel = ((Long) powerGrant.get(key)).intValue();
|
|
||||||
item_power_grant.put(powerString, powerLevel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user