mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-26 16:39:45 +00:00
Notification of being moved to the default group only happens if it's a
demotion/promotion (not on join).
This commit is contained in:
parent
52c2110a2b
commit
4ac5551c6b
2 changed files with 8 additions and 2 deletions
|
@ -69,4 +69,5 @@ v 1.5:
|
||||||
If the files have been altered (on disc) it will reload, so long as the in-memory data hasn't changed.
|
If the files have been altered (on disc) it will reload, so long as the in-memory data hasn't changed.
|
||||||
If the files on Disc have changed AND there have been changes to it's in-memory data it will show a warning.
|
If the files on Disc have changed AND there have been changes to it's in-memory data it will show a warning.
|
||||||
You then MUST issue a '/mansave force' to overwrite the disc files, or a '/manload' to overwrite the memory data.
|
You then MUST issue a '/mansave force' to overwrite the disc files, or a '/manload' to overwrite the memory data.
|
||||||
- Fix for an error in checkFullUserPermission caused by players disconnecting mid perms update.
|
- Fix for an error in checkFullUserPermission caused by players disconnecting mid perms update.
|
||||||
|
- Notification of being moved to the default group only happens if it's a demotion/promotion (not on join).
|
|
@ -117,13 +117,18 @@ public class User extends DataUnit implements Cloneable {
|
||||||
getDataSource().addGroup(group);
|
getDataSource().addGroup(group);
|
||||||
}
|
}
|
||||||
group = getDataSource().getGroup(group.getName());
|
group = getDataSource().getGroup(group.getName());
|
||||||
|
// Do we notify of the group change?
|
||||||
|
String defaultGroupName = getDataSource().getDefaultGroup().getName();
|
||||||
|
// if we are not in the default group
|
||||||
|
// or we are in the default group and the move is to a different group.
|
||||||
|
boolean notify = (this.group != defaultGroupName) || ((this.group == defaultGroupName) && (group.getName() != defaultGroupName)) ;
|
||||||
this.group = group.getName();
|
this.group = group.getName();
|
||||||
flagAsChanged();
|
flagAsChanged();
|
||||||
if (GroupManager.isLoaded()) {
|
if (GroupManager.isLoaded()) {
|
||||||
if (GroupManager.BukkitPermissions.player_join = false)
|
if (GroupManager.BukkitPermissions.player_join = false)
|
||||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||||
|
|
||||||
GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName()));
|
if (notify) GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue