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