Ejemplo n.º 1
0
  public Settings(File folder) {
    config = new YamlStorage(new File(folder, "config.yml"), "Citizens Configuration");
    root = config.getKey("");

    config.load();
    for (Setting setting : Setting.values()) {
      if (!root.keyExists(setting.path)) {
        setting.setAtKey(root);
      } else setting.loadFromKey(root);
    }

    save();
  }
Ejemplo n.º 2
0
 private static Collection<TaggedRegion> loadRegions(File file) {
   Collection<TaggedRegion> ret = Lists.newArrayList();
   Storage storage = new NBTStorage(file, "Schematic");
   storage.load();
   for (DataKey sub : storage.getKey("TaggedRegions").getSubKeys()) {
     String name = sub.name();
     for (DataKey sub2 : sub.getIntegerSubKeys()) {
       Location min = loadLocation(sub2.getRelative("min"));
       Location max = loadLocation(sub2.getRelative("max"));
       ret.add(new TaggedRegion(name, min, max));
     }
   }
   return ret;
 }
Ejemplo n.º 3
0
  public void reload() {
    config.load();
    for (Setting setting : Setting.values())
      if (root.keyExists(setting.path)) setting.loadFromKey(root);

    save();
  }
Ejemplo n.º 4
0
 public void save() {
   config.save();
 }