Package org.bukkit.configuration.file

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


    War.war.getMysqlConfig().saveTo(mysqlSection);

    // Save to disk
    File warConfigFile = new File(War.war.getDataFolder().getPath() + "/war.yml");
    try {
      warYmlConfig.save(warConfigFile);
    } catch (IOException e) {
      War.war.log("Failed to save war.yml", Level.WARNING);
      e.printStackTrace();
    }
  }
View Full Code Here


    }

    // Save to disk
    try {
      File warzoneConfigFile = new File(War.war.getDataFolder().getPath() + "/warzone-" + warzone.getName() + ".yml");
      warzoneYmlConfig.save(warzoneConfigFile);
    } catch (IOException e) {
      War.war.log("Failed to save warzone-" + warzone.getName() + ".yml", Level.WARNING);
      e.printStackTrace();
    }
  }
View Full Code Here

        // And on disk
        File file = new File(dir, p.getName());
        YamlConfiguration config = new YamlConfiguration();
        config.set("items", items);
        config.set("armor", armor);
        config.save(file);
       
        // And clear the inventory
        clearInventory(p);
        p.updateInventory();
    }
View Full Code Here

        File file = new File(getDataFolder(), "announcements.yml");
        try {
            if (file.createNewFile()) {
                Messenger.info("announcements.yml created.");
                YamlConfiguration yaml = Msg.toYaml();
                yaml.save(file);
                return;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

           
            this.titles.add(new Title(titleName, titleShortName, titleColor, levelReq));
        }
       
        try {
            conf.save(f);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
   
View Full Code Here

                        conf.getDouble("restrictedareas."+areaKey+".point2.z", 0.0));
                this.restrictedAreas.add(new RestrictedArea(point1, point2, multiplier));
            }
        }
        try {
            conf.save(f);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            } else {
                jobs.add(job);
            }
        }
        try {
            conf.save(f);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
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

            partiesFile.set(partyName + ".Members", members);
        }

        try {
            partiesFile.save(partyFile);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

        CustomEntity customEntity = new CustomEntity(1.0D, false, 0, false, null, 0);
        customEntityTypeMap.put(entityName, customEntity);
        customEntityClassMap.put(className, customEntity);

        try {
            entitiesFile.save(entityFile);
            mcMMO.p.debug(entity.getType().toString() + " was added to the custom entities file!");
        }
        catch (Exception e) {
            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.