Package org.bukkit.configuration.file

Examples of org.bukkit.configuration.file.YamlConfiguration.load()


   String filename = file.getName();
   if (filename.endsWith(".yml")) {
    String sectionName = filename.replaceAll("\\.yml$", "");
    FileConfiguration sectionConfig = new YamlConfiguration();
    sectionConfig.options().pathSeparator(this.options().pathSeparator());
    sectionConfig.load(file);
    this.putSection(sectionName, sectionConfig);
   }
  }
}
protected void putSection(String name, ConfigurationSection section) {
View Full Code Here


     
      YamlConfiguration uConfig = new YamlConfiguration();
      YamlConfiguration gConfig = new YamlConfiguration();
      try {
      uConfig.load(users);
      gConfig.load(groups);
      } catch (Exception e) {
        e.printStackTrace();
      }
      ConfigurationSection usConfig = uConfig.getConfigurationSection("users");
      ConfigurationSection grConfig = gConfig.getConfigurationSection("groups");
View Full Code Here

            }
            try {
                File langFile = new File(new File(dataFolder, "Language"), cmanager.getLanguage() + ".yml");
                if (langFile.isFile()) {
                    FileConfiguration langconfig = new YamlConfiguration();
                    langconfig.load(langFile);
                    helppages = HelpEntry.parseHelp(langconfig, "CommandHelp");
                    HelpEntry.setLinesPerPage(langconfig.getInt("HelpLinesPerPage", 7));
                    InformationPager.setLinesPerPage(langconfig.getInt("HelpLinesPerPage", 7));
                    language = Language.parseText(langconfig, "Language");
                } else {
View Full Code Here

    private boolean checkNewLanguageVersion(String lang) throws IOException, FileNotFoundException, InvalidConfigurationException {
        File outFile = new File(new File(this.getDataFolder(), "Language"), lang + ".yml");
        File checkFile = new File(new File(this.getDataFolder(), "Language"), "temp-" + lang + ".yml");
        if (outFile.isFile()) {
            FileConfiguration testconfig = new YamlConfiguration();
            testconfig.load(outFile);
            int oldversion = testconfig.getInt("FieldsVersion", 0);
            if (!this.writeDefaultFileFromJar(checkFile, "languagefiles/" + lang + ".yml", false)) {
                return false;
            }
            FileConfiguration testconfig2 = new YamlConfiguration();
View Full Code Here

            int oldversion = testconfig.getInt("FieldsVersion", 0);
            if (!this.writeDefaultFileFromJar(checkFile, "languagefiles/" + lang + ".yml", false)) {
                return false;
            }
            FileConfiguration testconfig2 = new YamlConfiguration();
            testconfig2.load(checkFile);
            int newversion = testconfig2.getInt("FieldsVersion", oldversion);
            if (checkFile.isFile()) {
                checkFile.delete();
            }
            if (newversion > oldversion) {
View Full Code Here

                               InvalidConfigurationException
    {
        CreeperLog.logInfo("Importing config from version 4", 1);
        YamlConfiguration config = new YamlConfiguration();
        File configFile = new File(CreeperHeal.getCHFolder() + "/config.yml");
        config.load(configFile);
        String tmp_str;
        try
        {
            tmp_str = config.getString("replacement-method", "block-per-block").trim();
        } catch (Exception e)
View Full Code Here

    {
        CreeperLog.logInfo("Importing config from version 5", 1);

        YamlConfiguration config = new YamlConfiguration();
        File configFile = new File(CreeperHeal.getCHFolder() + "/config.yml");
        config.load(configFile);
        File advancedFile = new File(CreeperHeal.getCHFolder() + "/advanced.yml");

        blockPerBlockInterval = config.getInt("replacement.block-per-block.interval", 20);
        waitBeforeHeal = config.getInt("replacement.wait-before-heal.explosions", 60);
        blockPerBlock = config.getBoolean("replacement.block-per-block", true);
View Full Code Here

                               InvalidConfigurationException
    {
        CreeperLog.logInfo("Importing config from version 6", 1);
        YamlConfiguration config = new YamlConfiguration();
        File configFile = new File(CreeperHeal.getCHFolder() + "/config.yml");
        config.load(configFile);
        YamlConfiguration advanced = new YamlConfiguration();
        File advancedFile = new File(CreeperHeal.getCHFolder() + "/advanced.yml");
        advanced.load(advancedFile);

        blockPerBlockInterval = config.getInt("block-per-block.interval", 20);
View Full Code Here

        YamlConfiguration config = new YamlConfiguration();
        File configFile = new File(CreeperHeal.getCHFolder() + "/config.yml");
        config.load(configFile);
        YamlConfiguration advanced = new YamlConfiguration();
        File advancedFile = new File(CreeperHeal.getCHFolder() + "/advanced.yml");
        advanced.load(advancedFile);

        blockPerBlockInterval = config.getInt("block-per-block.interval", 20);
        waitBeforeHeal = config.getInt("wait-before-heal.explosions", 60);
        blockPerBlock = config.getBoolean("block-per-block.enabled", true);
        waitBeforeHealBurnt = config.getInt("wait-before-heal.fire", 45);
View Full Code Here

    {

        YamlConfiguration config = new YamlConfiguration();
        try
        {
            config.load(new File(CreeperHeal.getCHFolder() + "/config.yml"));
        } catch (Exception e)
        {
            e.printStackTrace();
            return;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.