Package org.bukkit.configuration.file

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


        if (!configFile.exists())
            return;
        YamlConfiguration config = new YamlConfiguration();
        try
        {
            config.load(configFile);
        } catch (Exception e)
        {
            e.printStackTrace();
            return;
        }
View Full Code Here


        File griefFile = new File(worldFolder + "/grief.yml");
        try
        {
            config.load(configFile);
            advanced.load(advancedFile);
            grief.load(griefFile);
        } catch (FileNotFoundException e)
        {} catch (IOException e)
        {} catch (InvalidConfigurationException e)
        {}
        for (OutDatedWCfgVal v : OutDatedWCfgVal.values())
View Full Code Here

    metaYaml.addDefault(tagDecayable, decayable);
   
    // start reading it
    File metaFile = new File(file.getAbsolutePath() + metaExtension);
    if (metaFile.exists()) {
      metaYaml.load(metaFile);
      groundLevelY = Math.max(0, metaYaml.getInt(tagGroundLevelY, groundLevelY));
      flipableX = metaYaml.getBoolean(tagFlipableX, flipableX);
      flipableZ = metaYaml.getBoolean(tagFlipableZ, flipableZ);
//      ScalableX = metaYaml.getBoolean(tagScalableX, ScalableX) && sizeX == 3;
//      ScalableZ = metaYaml.getBoolean(tagScalableZ, ScalableZ) && sizeZ == 3;
View Full Code Here

       
        YamlConfiguration config = null;
        if(yamlFile.exists()) {
            try {
                config = new YamlConfiguration();
                config.load(yamlFile);
            } catch(Exception e) {
                e.printStackTrace();
            }
        }
        return config;
View Full Code Here

            File file = new File(worldsFolder, group + File.separator + player.getUniqueId().toString() + ".ec.yml");
            String playername = player.getName();
            YamlConfiguration playerFile = new YamlConfiguration();
            if(file.exists()) {
                try {
                    playerFile.load(file);
                } catch(Exception e) {
                    e.printStackTrace();
                    return;
                }
            }
View Full Code Here

            }
        }

        // read in config
        try {
            conf.load(file);
        } catch (IOException e) {
            GlowServer.logger.log(Level.SEVERE, "Failed to read config: " + file, e);
        } catch (InvalidConfigurationException e) {
            report(file, e);
        }
View Full Code Here

        final File bukkitYml = new File("bukkit.yml");
        if (bukkitYml.exists()) {
            YamlConfiguration bukkit = new YamlConfiguration();
            try {
                bukkit.load(bukkitYml);
            } catch (InvalidConfigurationException e) {
                report(bukkitYml, e);
            } catch (IOException e) {
                GlowServer.logger.log(Level.WARNING, "Could not migrate from " + bukkitYml, e);
            }
View Full Code Here

    private void migrateWorldConfig() { // SUPPRESS CHECKSTYLE: MethodLength
        FileConfiguration wconf = new YamlConfiguration();
        wconf.options().pathSeparator(PATH_SEPARATOR);
        File worldsFile = new File(getDataFolder(), "worlds.yml");
        try {
            wconf.load(worldsFile);
        } catch (IOException e) {
            log(Level.WARNING, "Cannot load worlds.yml");
        } catch (InvalidConfigurationException e) {
            log(Level.WARNING, "Your worlds.yml is invalid!");
        }
View Full Code Here

    List<Shop> shops   = new ArrayList<Shop>();
   
    for (File file : shopDir.listFiles()) {
      try {
        YamlConfiguration conf = new YamlConfiguration();
        conf.load(file);
       
        // deserialize
        Shop shop = (Shop)conf.get(PATH);
       
        // reset has changed
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.