Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (String name : properties.stringPropertyNames()) {
- try {
- String value = properties.getProperty(name);
- switch (name) {
- case "debug":
- case "classname":
- case "classpath":
- case "sharedClassLoader":
- break; //ignore
- default:
- if (name.startsWith("casttime")) {
- String[] split = value.split(",");
- String spellname = split[0];
- int newVal = Integer.parseInt(split[1]);
- spellCastTimes.put(spellname, newVal);
- } else if (name.startsWith("cost")) {
- String[] split = value.split(",");
- String spellname = split[0];
- int newVal = Integer.parseInt(split[1]);
- spellCosts.put(spellname, newVal);
- } else if (name.startsWith("difficulty")) {
- String[] split = value.split(",");
- String spellname = split[0];
- int newVal = Integer.parseInt(split[1]);
- spellDifficulties.put(spellname, newVal);
- } else if (name.startsWith("faith")) {
- String[] split = value.split(",");
- String spellname = split[0];
- int newVal = Integer.parseInt(split[1]);
- spellFaithRequirements.put(spellname, newVal);
- } else if (name.startsWith("cooldown")) {
- String[] split = value.split(",");
- String spellname = split[0];
- long newVal = Long.parseLong(split[1]);
- spellCooldowns.put(spellname, newVal);
- } else if (name.startsWith("addspell")) {
- String[] split = value.split(";");
- String spellname = split[0];
- List<String> deityList = Arrays.asList(split[1].split(","));
- addSpells.put(spellname, deityList);
- } else if (name.startsWith("removespell")) {
- String[] split = value.split(";");
- String spellname = split[0];
- List<String> deityList = Arrays.asList(split[1].split(","));
- removeSpells.put(spellname, deityList);
- } else {
- //Debug("Unknown config property: " + name);
- }
- }
- } catch (Exception e) {
- Debug("Error processing property " + name);
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment