コード例 #1
0
ファイル: ConfigEffects.java プロジェクト: scizzr/PKSystem
  static void load() {
    YamlConfiguration config = new YamlConfiguration();
    File file = Main.fileConfigEffects;

    try {
      config.load(file);
    } catch (Exception ex) {
      Main.log.info(Main.prefixConsole + "There was a problem loading configEffects.yml");
      Main.suicide(ex);
    }

    checkOption(config, "effects.invis.enabled", Config.effInvisEnabled);
    Config.effInvisEnabled = config.getBoolean("effects.invis.enabled");
    checkOption(config, "effects.invis.min", Config.effInvisMin);
    Config.effInvisMin = config.getInt("effects.invis.min");
    checkOption(config, "effects.invis.max", Config.effInvisMax);
    Config.effInvisMax = config.getInt("effects.invis.max");
    checkOption(config, "effects.lightning.enabled", Config.effLightEnabled);
    Config.effLightEnabled = config.getBoolean("effects.lightning.enabled");
    checkOption(config, "effects.potions.enabled", Config.effPotsEnabled);
    Config.effPotsEnabled = config.getBoolean("effects.potions.enabled");
    checkOption(config, "effects.smoke.incombat", Config.effSmokeCombat);
    Config.effSmokeCombat = config.getBoolean("effects.smoke.incombat");
    checkOption(config, "effects.smoke.inpk", Config.effSmokeInPK);
    Config.effSmokeInPK = config.getBoolean("effects.smoke.inpk");
    checkOption(config, "effects.smoke.invis", Config.effSmokeInvis);
    Config.effSmokeInvis = config.getBoolean("effects.smoke.invis");
    checkOption(config, "effects.special.demon", Config.effSpecDemon);
    Config.effSpecDemon = config.getBoolean("effects.special.demon");
    checkOption(config, "effects.special.hero", Config.effSpecHero);
    Config.effSpecHero = config.getBoolean("effects.special.hero");
    checkOption(config, "effects.special.neutral", Config.effSpecNeutral);
    Config.effSpecNeutral = config.getBoolean("effects.special.neutral");
    checkOption(config, "effects.nameplates", Config.effNameplates);
    Config.effNameplates = config.getBoolean("effects.nameplates");

    if (changed) {
      config.options().header("PKSystem Configuration - Effects");
      try {
        config.save(file);
      } catch (Exception ex) {
        Main.log.info(Main.prefixConsole + "Failed to save configEffects.yml");
        Main.suicide(ex);
      }
    }
  }
コード例 #2
0
ファイル: ConfigRep.java プロジェクト: scizzr/PKSystem
  public static void main() {
    File file = new File(Main.fileConfigPoints.getAbsolutePath());

    if (!file.exists()) {
      try {
        file.createNewFile();
        Main.log.info(Main.prefixConsole + "Blank configPoints.yml created");
      } catch (IOException ex) {
        Main.log.info(Main.prefixConsole + "Failed to make configPoints.yml");
        Main.suicide(ex);
      }
    }

    load();
  }
コード例 #3
0
ファイル: ConfigRep.java プロジェクト: scizzr/PKSystem
  static void load() {
    YamlConfiguration config = new YamlConfiguration();
    File file = Main.fileConfigPoints;

    try {
      config.load(file);
    } catch (Exception ex) {
      Main.log.info(Main.prefixConsole + "There was a problem loading configPoints.yml");
      Main.suicide(ex);
    }

    checkOption(config, "attack.xxx", Config.repGuide);
    checkOption(config, "attack.dem", Config.repAtkDem);
    Config.repAtkDem = config.getString("attack.dem");
    checkOption(config, "attack.red", Config.repAtkRed);
    Config.repAtkRed = config.getString("attack.red");
    checkOption(config, "attack.ora", Config.repAtkOra);
    Config.repAtkOra = config.getString("attack.ora");
    checkOption(config, "attack.yel", Config.repAtkYel);
    Config.repAtkYel = config.getString("attack.yel");
    checkOption(config, "attack.whi", Config.repAtkWhi);
    Config.repAtkWhi = config.getString("attack.whi");
    checkOption(config, "attack.ltb", Config.repAtkLtB);
    Config.repAtkLtB = config.getString("attack.ltb");
    checkOption(config, "attack.blu", Config.repAtkBlu);
    Config.repAtkBlu = config.getString("attack.blu");
    checkOption(config, "attack.pur", Config.repAtkPur);
    Config.repAtkPur = config.getString("attack.pur");
    checkOption(config, "attack.her", Config.repAtkHer);
    Config.repAtkHer = config.getString("attack.her");

    checkOption(config, "defend.xxx", Config.repGuide);
    checkOption(config, "defend.dem", Config.repDefDem);
    Config.repDefDem = config.getString("defend.dem");
    checkOption(config, "defend.red", Config.repDefRed);
    Config.repDefRed = config.getString("defend.red");
    checkOption(config, "defend.ora", Config.repDefOra);
    Config.repDefOra = config.getString("defend.ora");
    checkOption(config, "defend.yel", Config.repDefYel);
    Config.repDefYel = config.getString("defend.yel");
    checkOption(config, "defend.whi", Config.repDefWhi);
    Config.repDefWhi = config.getString("defend.whi");
    checkOption(config, "defend.ltb", Config.repDefLtB);
    Config.repDefLtB = config.getString("defend.ltb");
    checkOption(config, "defend.blu", Config.repDefBlu);
    Config.repDefBlu = config.getString("defend.blu");
    checkOption(config, "defend.pur", Config.repDefPur);
    Config.repDefPur = config.getString("defend.pur");
    checkOption(config, "defend.her", Config.repDefHer);
    Config.repDefHer = config.getString("defend.her");

    checkOption(config, "rep.special.enabled", Config.repSpecEnabled);
    Config.repSpecEnabled = config.getBoolean("rep.special.enabled");
    checkOption(config, "rep.special.reach", Config.repSpecReach);
    Config.repSpecReach = config.getBoolean("rep.special.reach");
    checkOption(config, "rep.limit.enabled", Config.repLimitEnabled);
    Config.repLimitEnabled = config.getBoolean("rep.limit.enabled");
    checkOption(config, "rep.limit.amount", Config.repLimitAmount);
    Config.repLimitAmount = config.getInt("rep.limit.amount");
    checkOption(config, "rep.limit.duration", Config.repLimitDuration);
    Config.repLimitDuration = config.getInt("rep.limit.duration");

    if (changed) {
      config.options().header("PKSystem Configuration - Points");
      try {
        config.save(file);
      } catch (Exception ex) {
        Main.log.info(Main.prefixConsole + "Failed to save configReputation.yml");
        Main.suicide(ex);
      }
    }
  }