Broader restricted permission rewards check

This commit is contained in:
PikaMug 2021-02-13 20:08:25 -05:00
parent 4a3ecb4248
commit 5353139dd3

View File

@ -967,33 +967,24 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (s.startsWith("/")) { if (s.startsWith("/")) {
s = s.substring(1); s = s.substring(1);
} }
switch (s.trim().split(" ")[0].toLowerCase()) { final String[] arr = {
case "*": "*",
case "*.*": "bukkit.command",
case "bukkit.*": "minecraft.command",
case "bukkit.command.*": "worledit"
case "bukkit.command.plugins": };
case "bukkit.command.reload": boolean found = false;
case "bukkit.command.timings": for (int i = 0; i < arr.length; i++) {
case "minecraft.*": if (s.startsWith(arr[i])) {
case "minecraft.command.*": found = true;
case "minecraft.command.ban": break;
case "minecraft.command.ban-ip": }
case "minecraft.command.deop": }
case "minecraft.command.kick": if (found) {
case "minecraft.command.kill":
case "minecraft.command.op":
case "minecraft.command.pardon":
case "minecraft.command.pardon-ip":
case "minecraft.command.save-all":
case "minecraft.command.save-off":
case "minecraft.command.save-on":
case "minecraft.command.stop":
case "minecraft.command.whitelist":
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption") context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")
+ ChatColor.DARK_RED + " (" + s.trim() + ")"); + ChatColor.DARK_RED + " (" + s.trim() + ")");
continue; continue;
default: } else {
permissions.add(s.trim()); permissions.add(s.trim());
} }
} }