1
0
mirror of https://github.com/LuckPerms/LuckPerms.git synced 2025-03-25 21:19:58 +01:00

Add web editor deletion cause

This commit is contained in:
Luck 2021-03-01 10:16:21 +00:00
parent ca65e2175d
commit 89894353b6
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 8 additions and 2 deletions
api/src/main/java/net/luckperms/api/event/cause
common/src/main/java/me/lucko/luckperms/common/webeditor

View File

@ -35,6 +35,12 @@ public enum DeletionCause {
*/
COMMAND,
/**
* The deletion was caused by the web editor
* @since 5.3
*/
WEB_EDITOR,
/**
* The deletion was caused by an API call
*/

View File

@ -328,7 +328,7 @@ public class WebEditorResponse {
}
try {
this.plugin.getStorage().deleteGroup(group, DeletionCause.COMMAND).get();
this.plugin.getStorage().deleteGroup(group, DeletionCause.WEB_EDITOR).get();
} catch (Exception e) {
e.printStackTrace();
Message.DELETE_ERROR.send(this.sender, group.getFormattedDisplayName());
@ -358,7 +358,7 @@ public class WebEditorResponse {
}
try {
this.plugin.getStorage().deleteTrack(track, DeletionCause.COMMAND).get();
this.plugin.getStorage().deleteTrack(track, DeletionCause.WEB_EDITOR).get();
} catch (Exception e) {
e.printStackTrace();
Message.DELETE_ERROR.send(this.sender, Component.text(track.getName()));