mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-09-06 21:18:03 +02:00
Fixed subgroups (I broke earlier).
This commit is contained in:
parent
e1660d47ba
commit
ae2cf3d95c
@ -118,4 +118,5 @@ v 1.9:
|
||||
- addSubGroup now returns a boolean for success/failure.
|
||||
- '/manuaddsub' now correctly reports if it was able to add the sub group.
|
||||
- Allow negation to the * permission node when populating superperms.
|
||||
- Fix trying to modify an unmodifiable collection breaking superperms.
|
||||
- Fix trying to modify an unmodifiable collection breaking superperms.
|
||||
- Fixed subgroups (I broke earlier).
|
@ -152,21 +152,27 @@ public class User extends DataUnit implements Cloneable {
|
||||
if (this.group.equalsIgnoreCase(subGroup.getName())) {
|
||||
return false;
|
||||
}
|
||||
// User already has this subgroup
|
||||
if (containsSubGroup(subGroup))
|
||||
return false;
|
||||
|
||||
// If the group doesn't exists add it
|
||||
if (!this.getDataSource().groupExists(subGroup.getName())) {
|
||||
getDataSource().addGroup(subGroup);
|
||||
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
if (!GroupManager.BukkitPermissions.isPlayer_join())
|
||||
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
|
||||
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
subGroups.add(subGroup.getName());
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
if (!GroupManager.BukkitPermissions.isPlayer_join())
|
||||
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
|
||||
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
|
||||
}
|
||||
return true;
|
||||
|
||||
//subGroup = getDataSource().getGroup(subGroup.getName());
|
||||
//removeSubGroup(subGroup);
|
||||
//subGroups.add(subGroup.getName());
|
||||
return false;
|
||||
}
|
||||
|
||||
public int subGroupsSize() {
|
||||
|
Loading…
Reference in New Issue
Block a user