mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Fixed subgroups (I broke earlier).
This commit is contained in:
parent
e1660d47ba
commit
ae2cf3d95c
2 changed files with 17 additions and 10 deletions
|
@ -119,3 +119,4 @@ v 1.9:
|
||||||
- '/manuaddsub' now correctly reports if it was able to add the sub group.
|
- '/manuaddsub' now correctly reports if it was able to add the sub group.
|
||||||
- Allow negation to the * permission node when populating superperms.
|
- 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,9 +152,16 @@ public class User extends DataUnit implements Cloneable {
|
||||||
if (this.group.equalsIgnoreCase(subGroup.getName())) {
|
if (this.group.equalsIgnoreCase(subGroup.getName())) {
|
||||||
return false;
|
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())) {
|
if (!this.getDataSource().groupExists(subGroup.getName())) {
|
||||||
getDataSource().addGroup(subGroup);
|
getDataSource().addGroup(subGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
subGroups.add(subGroup.getName());
|
||||||
flagAsChanged();
|
flagAsChanged();
|
||||||
if (GroupManager.isLoaded()) {
|
if (GroupManager.isLoaded()) {
|
||||||
if (!GroupManager.BukkitPermissions.isPlayer_join())
|
if (!GroupManager.BukkitPermissions.isPlayer_join())
|
||||||
|
@ -162,11 +169,10 @@ public class User extends DataUnit implements Cloneable {
|
||||||
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
|
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
//subGroup = getDataSource().getGroup(subGroup.getName());
|
//subGroup = getDataSource().getGroup(subGroup.getName());
|
||||||
//removeSubGroup(subGroup);
|
//removeSubGroup(subGroup);
|
||||||
//subGroups.add(subGroup.getName());
|
//subGroups.add(subGroup.getName());
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int subGroupsSize() {
|
public int subGroupsSize() {
|
||||||
|
|
Loading…
Reference in a new issue