diff --git a/src/main/java/de/rayzs/pat/plugin/process/CommandProcess.java b/src/main/java/de/rayzs/pat/plugin/process/CommandProcess.java index 820b0a33..5dc74a4e 100644 --- a/src/main/java/de/rayzs/pat/plugin/process/CommandProcess.java +++ b/src/main/java/de/rayzs/pat/plugin/process/CommandProcess.java @@ -135,7 +135,7 @@ public class CommandProcess { sender.sendMessage((bool ? Storage.GROUP_DELETE_MESSAGE : Storage.GROUP_NOT_EXIST_MESSAGE).replace("%group%", sub.toLowerCase())); return; - case "clear": case "cls": + case "clear": if(!PermissionUtil.hasPermissionWithResponse(sender, "clear")) return; group = GroupManager.getGroupByName(sub); diff --git a/src/main/java/de/rayzs/pat/utils/Storage.java b/src/main/java/de/rayzs/pat/utils/Storage.java index fd0d91e4..e9e4d3e2 100644 --- a/src/main/java/de/rayzs/pat/utils/Storage.java +++ b/src/main/java/de/rayzs/pat/utils/Storage.java @@ -9,8 +9,9 @@ public class Storage { public static List UNKNOWN_COMMAND, BLOCKED_COMMANDS_LIST, COMMAND_HELP = new ArrayList<>(), UPDATE_NOTIFICATION = new ArrayList<>(); public static List NOTIFY_PLAYERS = new ArrayList<>(); public static String TOKEN = UUID.randomUUID().toString(), BUNGEECORD_MESSAGE, NOTIFY_ALERT, NOTIFY_ENABLED, NOTIFY_DISABLED, CANCEL_COMMANDS_MESSAGE, COMMAND_UNKNOWN, NO_PERMISSIONS, RELOAD_LOADING, RELOAD_DONE, - BLACKLIST_CLEAR_MESSAGE, BLACKLIST_LIST_COMMAND_MESSAGE, BLACKLIST_ADD_MESSAGE, BLACKLIST_ADD_FAIL_MESSAGE, BLACKLIST_REMOVE_MESSAGE, BLACKLIST_REMOVE_FAIL_MESSAGE, BLACKLIST_LIST_MESSAGE, BLACKLIST_LIST_SPLITTER_MESSAGE, - GROUP_CREATE_MESSAGE, GROUP_DELETE_MESSAGE, GROUP_ALREADY_CREATED_MESSAGE, GROUP_NOT_EXIST_MESSAGE, GROUP_CLEAR_MESSAGE, GROUP_LIST_COMMAND_MESSAGE, GROUP_ADD_MESSAGE, GROUP_ADD_FAIL_MESSAGE, GROUP_REMOVE_MESSAGE, GROUP_REMOVE_FAIL_MESSAGE, GROUP_LIST_MESSAGE, GROUP_LIST_SPLITTER_MESSAGE, GROUPS_LIST_MESSAGE, GROUPS_LIST_SPLITTER_MESSAGE, GROUPS_LIST_GROUPS_MESSAGE; + BLACKLIST_CLEAR_CONFIRM_MESSAGE, BLACKLIST_CLEAR_MESSAGE, BLACKLIST_LIST_COMMAND_MESSAGE, BLACKLIST_ADD_MESSAGE, BLACKLIST_ADD_FAIL_MESSAGE, BLACKLIST_REMOVE_MESSAGE, BLACKLIST_REMOVE_FAIL_MESSAGE, BLACKLIST_LIST_MESSAGE, BLACKLIST_LIST_SPLITTER_MESSAGE, + GROUP_CREATE_MESSAGE, GROUP_DELETE_MESSAGE, GROUP_ALREADY_CREATED_MESSAGE, GROUP_NOT_EXIST_MESSAGE, GROUP_CLEAR_MESSAGE, GROUP_LIST_COMMAND_MESSAGE, GROUP_ADD_MESSAGE, GROUP_ADD_FAIL_MESSAGE, GROUP_REMOVE_MESSAGE, GROUP_REMOVE_FAIL_MESSAGE, GROUP_LIST_MESSAGE, GROUP_LIST_SPLITTER_MESSAGE, GROUPS_LIST_MESSAGE, GROUPS_LIST_SPLITTER_MESSAGE, GROUPS_LIST_GROUPS_MESSAGE, + GROUP_CLEAR_CONFIRM_MESSAGE; public static boolean BUNGEECORD = false, USE_UNKNOWN_COMMAND, TURN_BLACKLIST_TO_WHITELIST, CANCEL_COMMANDS, UPDATE_ENABLED, OUTDATED_VERSION = false, CONSOLE_NOTIFICATION_ENABLED = true; public static int UPDATE_PERIOD; @@ -67,6 +68,7 @@ public class Storage { TURN_BLACKLIST_TO_WHITELIST = (boolean) CONFIGURATION.getOrSet("turn-blacklist-to-whitelist", false); BLACKLIST_CLEAR_MESSAGE = (String) CONFIGURATION.getOrSet("blacklist.clear", "&aList has been cleared!"); + BLACKLIST_CLEAR_CONFIRM_MESSAGE = (String) CONFIGURATION.getOrSet("blacklist.clear-confirmation", "&4&lWarning! &7This command will &cclear the entire list&7! &eRepeat the &nsame command &eto confirm this action."); BLACKLIST_LIST_MESSAGE = (String) CONFIGURATION.getOrSet("blacklist.list.message", "&7Listed commands (&f%size%&7)&8: &f%commands%"); BLACKLIST_LIST_SPLITTER_MESSAGE = (String) CONFIGURATION.getOrSet("blacklist.list.splitter", "&7, "); BLACKLIST_LIST_COMMAND_MESSAGE = (String) CONFIGURATION.getOrSet("blacklist.list.command", "&f"); @@ -85,6 +87,7 @@ public class Storage { GROUP_NOT_EXIST_MESSAGE = (String) CONFIGURATION.getOrSet("group.does-not-exist", "&cGroup %group% does not exist!"); GROUP_DELETE_MESSAGE = (String) CONFIGURATION.getOrSet("group.delete", "&cGroup %group% has been deleted!"); GROUP_CLEAR_MESSAGE = (String) CONFIGURATION.getOrSet("group.clear", "&aList of group %group% has been cleared!"); + GROUP_CLEAR_CONFIRM_MESSAGE = (String) CONFIGURATION.getOrSet("group.clear-confirmation", "&4&lWarning! &7This command will &cclear the entire list&7 of this group! &eRepeat the &nsame command &eto confirm this action."); GROUP_LIST_MESSAGE = (String) CONFIGURATION.getOrSet("group.list.message", "&7Listed commands of group %group% (&f%size%&7)&8: &f%commands%"); GROUP_LIST_SPLITTER_MESSAGE = (String) CONFIGURATION.getOrSet("group.list.splitter", "&7, "); GROUP_LIST_COMMAND_MESSAGE = (String) CONFIGURATION.getOrSet("group.list.command", "&f"); diff --git a/src/main/resources/files/bukkit-config.yml b/src/main/resources/files/bukkit-config.yml index 3f193990..636c84cc 100644 --- a/src/main/resources/files/bukkit-config.yml +++ b/src/main/resources/files/bukkit-config.yml @@ -34,6 +34,7 @@ reload: blacklist: clear: '&aList has been cleared!' + clear-confirmation: '&4&lWarning! &7This command will &cclear the entire list&7! &eRepeat the &nsame command &eto confirm this action.' list: message: '&7Listed commands (&f%size%&7)&8: &f%commands%' @@ -53,6 +54,7 @@ group: already-exist: '&cGroup %group% already exist!' does-not-exist: '&cGroup %group% does not exist!' clear: '&aList of group %group% has been cleared!' + clear-confirmation: '&4&lWarning! &7This command will &cclear the entire list&7 of this group! &eRepeat the &nsame command &eto confirm this action.' list-groups: message: '&7All groups (&f%size%&7)&8: &f%groups%' diff --git a/src/main/resources/files/bungee-config.yml b/src/main/resources/files/bungee-config.yml index b8499608..7e76f71f 100644 --- a/src/main/resources/files/bungee-config.yml +++ b/src/main/resources/files/bungee-config.yml @@ -26,6 +26,7 @@ reload: blacklist: clear: '&aList has been cleared!' + clear-confirmation: '&4&lWarning! &7This command will &cclear the entire list&7! &eRepeat the &nsame command &eto confirm this action.' list: message: '&7Listed commands (&f%size%&7)&8: &f%commands%' @@ -44,6 +45,7 @@ group: does-not-exist: '&cGroup %group% does not exist!' delete: '&cGroup %group% has been deleted!' clear: '&aList of group %group% has been cleared!' + clear-confirmation: '&4&lWarning! &7This command will &cclear the entire list&7 of this group! &eRepeat the &nsame command &eto confirm this action.' list-groups: message: '&7All groups (&f%size%&7)&8: &f%groups%' diff --git a/src/main/resources/files/velocity-config.yml b/src/main/resources/files/velocity-config.yml index 8adbdc86..b9492644 100644 --- a/src/main/resources/files/velocity-config.yml +++ b/src/main/resources/files/velocity-config.yml @@ -24,6 +24,7 @@ reload: blacklist: clear: '&aList has been cleared!' + clear-confirmation: '&4&lWarning! &7This command will &cclear the entire list&7! &eRepeat the &nsame command &eto confirm this action.' list: message: '&7Listed commands (&f%size%&7)&8: &f%commands%' @@ -42,6 +43,7 @@ group: does-not-exist: '&cGroup %group% does not exist!' delete: '&cGroup %group% has been deleted!' clear: '&aList of group %group% has been cleared!' + clear-confirmation: '&4&lWarning! &7This command will &cclear the entire list&7 of this group! &eRepeat the &nsame command &eto confirm this action.' list-groups: message: '&7All groups (&f%size%&7)&8: &f%groups%'