summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-15 22:52:05 +0100
committersnowleo <schneeleo@gmail.com>2011-11-15 22:52:05 +0100
commiteda827b244e3cc4cb58513bb6306c154cc3e8d5d (patch)
treee265fc2e3e631dad4c3697f6b0f2a2dd6344d3f8
parent27ee7efde5c3ae65ce2dd98bc0b6b201d751683e (diff)
parentf4e22a17db5cf86fbf972f1584fcc2858af75022 (diff)
downloadEssentials-eda827b244e3cc4cb58513bb6306c154cc3e8d5d.tar
Essentials-eda827b244e3cc4cb58513bb6306c154cc3e8d5d.tar.gz
Essentials-eda827b244e3cc4cb58513bb6306c154cc3e8d5d.tar.lz
Essentials-eda827b244e3cc4cb58513bb6306c154cc3e8d5d.tar.xz
Essentials-eda827b244e3cc4cb58513bb6306c154cc3e8d5d.zip
Merge branch 'refs/heads/groupmanager'
-rw-r--r--EssentialsGroupManager/src/globalgroups.yml5
-rw-r--r--EssentialsGroupManager/src/groups.yml8
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java19
3 files changed, 25 insertions, 7 deletions
diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml
index 43c225b6a..9662baf43 100644
--- a/EssentialsGroupManager/src/globalgroups.yml
+++ b/EssentialsGroupManager/src/globalgroups.yml
@@ -142,11 +142,6 @@ groups:
g:bukkit_admin:
permissions:
- - bPermissions.admin
- - bPermissions.demote.admin
- - bPermissions.gui
- - bPermissions.iplock.lock
- - bPermissions.promote.admin
- bukkit.broadcast
- bukkit.broadcast.admin
- bukkit.command
diff --git a/EssentialsGroupManager/src/groups.yml b/EssentialsGroupManager/src/groups.yml
index ac4abeb4a..81fb4f030 100644
--- a/EssentialsGroupManager/src/groups.yml
+++ b/EssentialsGroupManager/src/groups.yml
@@ -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
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.