Package org.bukkit.configuration.file

Examples of org.bukkit.configuration.file.FileConfiguration.save()


    if (userIsNotAdded && sender.hasPermission("ECM.adduser")
        || sender.hasPermission("ECM.*")) {
      if (configExists) {
        userName.set("EMC.Users", user);
        userName.save("plugins" + File.pathSeparator + "ECM"
            + File.pathSeparator + "users.yml");
        chat.finishMessage(sender, "You have let " + user.toLowerCase()
            + " use ECM correctly!");
      } else {
        FileWriter outFile = new FileWriter(configFile, true);
View Full Code Here


        FileWriter outFile = new FileWriter(configFile, true);
        PrintWriter out = new PrintWriter(outFile);
        out.println("#Users For ECM go in here! Do not touch this! Use the ingame command!");
        out.close();
        userName.set("EMC.Users", user);
        userName.save("plugins" + File.pathSeparator + "ECM"
            + File.pathSeparator + "users.yml");
        chat.finishMessage(
            sender,
            "You have let "
                + user.toLowerCase()
View Full Code Here

    FileConfiguration config = plugin.getConfig();

    if (args.get("value") != null) {
      config.set(nodeName, this.parseValue(args.get("value")));
      try {
        config.save(new File(plugin.getDataFolder(), "config.yml"));
      } catch (Throwable e) {
        sender.sendMessage(ChatColor.RED + "[PermissionsEx] Failed to save configuration: " + e.getMessage());
      }
    }
View Full Code Here

    continue;
   if (this.isConfigurationSection(sectionName)) {
    FileConfiguration sectionConfig = new YamlConfiguration();
    sectionConfig.addDefaults(this.getConfigurationSection(sectionName).getValues(true));
    sectionConfig.options().copyDefaults(true);
    sectionConfig.save(new File(directory, sectionName + ".yml"));
   }
  }
}
// No-op saver; this is a directory-based configuration, so this is meaningless
public String saveToString() { return ""; }
View Full Code Here

            this.enabled = false;
            return;
        }
        config.setDefaults(YamlConfiguration.loadConfiguration(stream));
        try {
            config.save(confFile);
        } catch (final IOException e) {
            this.plugin.getServer().getLogger().log(Level.SEVERE, "Could not save spoutcraft.yml", e);
        }
        for (final String skinGroup : config.getConfigurationSection("skins").getKeys(false)) {
            this.skins.put(skinGroup, config.getString("skins." + skinGroup));
View Full Code Here

        // change a value here
        FileConfiguration config = YamlConfiguration.loadConfiguration(new File(core.getDataFolder(), "worlds.yml"));
        WorldProperties worldObj = (WorldProperties) config.get("worlds.world");
        assertTrue(worldObj.setColor("GREEN"));
        config.set("worlds.world", worldObj);
        config.save(new File(core.getDataFolder(), "worlds.yml"));
        // load
        core.loadConfigs();

        mvWorld = worldManager.getMVWorld("world");
        assertEquals(true, mvWorld.isHidden());
View Full Code Here

            languageConfig.options().copyDefaults(true); // copy defaults, too
            // force update of admin.help
            languageConfig.set("admin.help", defConfig.getString("admin.help"));
            try {
              // save updated config
              languageConfig.save(languageFile);
            } catch (Exception e) {
              SimpleSpleef.log.warning("[SimpleSpleef] Warning: Could not write lang_" + language + ".yml - reason: " + e.getMessage());
            }
        }
    }
View Full Code Here

            for (Map.Entry<String, Object> entry : newValues.entrySet()) {
                rootSection.set(entry.getKey(), entry.getValue());
            }

            try {
                wconf.save(new File(getDataFolder(), "worlds.yml"));
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
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.