mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +01:00
Fix promotions/demotions
This commit is contained in:
parent
f24562c642
commit
1870893fe1
@ -65,9 +65,11 @@ public class UserDemote extends UserSubCommand {
|
||||
|
||||
try {
|
||||
user.unsetPermission("group." + old);
|
||||
} catch (ObjectLacksException ignored) {}
|
||||
try {
|
||||
user.addGroup(previousGroup);
|
||||
user.setPrimaryGroup(previousGroup.getName());
|
||||
} catch (ObjectLacksException | ObjectAlreadyHasException ignored) {}
|
||||
} catch (ObjectAlreadyHasException ignored) {}
|
||||
user.setPrimaryGroup(previousGroup.getName());
|
||||
|
||||
Message.USER_DEMOTE_SUCCESS_PROMOTE.send(sender, track.getName(), old, previousGroup.getName());
|
||||
Message.USER_DEMOTE_SUCCESS_REMOVE.send(sender, user.getName(), old, previousGroup.getName(), previousGroup.getName());
|
||||
|
@ -65,9 +65,11 @@ public class UserPromote extends UserSubCommand {
|
||||
|
||||
try {
|
||||
user.unsetPermission("group." + old);
|
||||
} catch (ObjectLacksException ignored) {}
|
||||
try {
|
||||
user.addGroup(nextGroup);
|
||||
user.setPrimaryGroup(nextGroup.getName());
|
||||
} catch (ObjectLacksException | ObjectAlreadyHasException ignored) {}
|
||||
} catch (ObjectAlreadyHasException ignored) {}
|
||||
user.setPrimaryGroup(nextGroup.getName());
|
||||
|
||||
Message.USER_PROMOTE_SUCCESS_PROMOTE.send(sender, track.getName(), old, nextGroup.getName());
|
||||
Message.USER_PROMOTE_SUCCESS_REMOVE.send(sender, user.getName(), old, nextGroup.getName(), nextGroup.getName());
|
||||
|
Loading…
Reference in New Issue
Block a user