diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-11-15 18:17:18 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-11-15 18:17:18 +0000 |
commit | f4e22a17db5cf86fbf972f1584fcc2858af75022 (patch) | |
tree | 1fe228245ab86388cebadd7c10aadd60797a87c7 /EssentialsGroupManager/src/org/anjocaido | |
parent | 437d3b41b891a13c2f683a292ff10a7c48126ed5 (diff) | |
download | Essentials-f4e22a17db5cf86fbf972f1584fcc2858af75022.tar Essentials-f4e22a17db5cf86fbf972f1584fcc2858af75022.tar.gz Essentials-f4e22a17db5cf86fbf972f1584fcc2858af75022.tar.lz Essentials-f4e22a17db5cf86fbf972f1584fcc2858af75022.tar.xz Essentials-f4e22a17db5cf86fbf972f1584fcc2858af75022.zip |
Added comments to groups.yml for global groups
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index 8f5fad5cf..e8e01967f 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -881,6 +881,7 @@ public class WorldDataHolder { Map<String, Object> root = new HashMap<String, Object>(); Map<String, Object> groupsMap = new HashMap<String, Object>(); + root.put("groups", groupsMap); for (String groupKey : ph.groups.keySet()) { Group group = ph.groups.get(groupKey); @@ -910,10 +911,24 @@ public class WorldDataHolder { opt.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); final Yaml yaml = new Yaml(opt); try { - yaml.dump(root, new OutputStreamWriter(new FileOutputStream(groupsFile), "UTF-8")); + OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(groupsFile), "UTF-8"); + + String newLine = System.getProperty("line.separator"); + + out.write("# Group inheritance" + newLine); + out.write("# any inherited groups prefixed with a g: are global groups" + newLine); + out.write("# These groups are defined in the globalgroups.yml" + newLine); + out.write("# and can be inherited in any worlds groups/users.yml." + newLine); + out.write("#" + newLine); + out.write("# Groups without the g: prefix are groups local to this world" + newLine); + out.write("# and defined in the this groups.yml file." + newLine); + out.write(newLine); + + yaml.dump(root, out); } catch (UnsupportedEncodingException ex) { } catch (FileNotFoundException ex) { - } + } catch (IOException e) { + } } // Update the LastModified time. |