1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-10 16:48:05 +02:00

Added comments to groups.yml for global groups

This commit is contained in:
ElgarL
2011-11-15 18:17:18 +00:00
parent 6a5658f4f4
commit 0e1e5c8ead
2 changed files with 25 additions and 2 deletions

View File

@@ -1,3 +1,11 @@
# Group inheritance
# any inherited groups prefixed with a g: are global groups
# These groups are defined in the globalgroups.yml
# and can be inherited in any worlds groups/users.yml.
#
# Groups without the g: prefix are groups local to this world
# and defined in the this groups.yml file.
groups:
Default:
default: true

View File

@@ -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.