diff options
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java index 84d4fceed..e580918e7 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java @@ -27,12 +27,22 @@ public class Group extends DataUnit implements Cloneable { private GroupVariables variables = new GroupVariables(this); /** + * Constructor for individual World Groups. * * @param name */ public Group(WorldDataHolder source, String name) { super(source, name); } + + /** + * Constructor for Global Groups. + * + * @param name + */ + public Group(String name) { + super(name); + } /** * Clone this group @@ -40,8 +50,15 @@ public class Group extends DataUnit implements Cloneable { */ @Override public Group clone() { - Group clone = new Group(getDataSource(), this.getName()); - clone.inherits = new ArrayList<String>(this.getInherits()); + Group clone; + + if (getDataSource() == null) { + clone = new Group(this.getName()); + } else { + clone = new Group(getDataSource(), this.getName()); + clone.inherits = new ArrayList<String>(this.getInherits()); + } + for (String perm : this.getPermissionList()) { clone.addPermission(perm); } |