mirror of
https://github.com/kaboomserver/extras.git
synced 2024-11-30 11:17:14 -05:00
Update command restrictions
This commit is contained in:
parent
811178d30a
commit
95d3e151df
1 changed files with 21 additions and 3 deletions
|
@ -95,8 +95,14 @@ public final class ServerCommand implements Listener {
|
||||||
arr[arr.length - 1] = "64";
|
arr[arr.length - 1] = "64";
|
||||||
return String.join(" ", arr);
|
return String.join(" ", arr);
|
||||||
}
|
}
|
||||||
} else if ("title".equalsIgnoreCase(arr[i + 1])) {
|
} else if ("bossbar".equalsIgnoreCase(arr[i + 1])
|
||||||
if (parseCharCodes(command).contains("selector")) {
|
|| "fill".equalsIgnoreCase(arr[i + 1])
|
||||||
|
|| "setblock".equalsIgnoreCase(arr[i + 1])
|
||||||
|
|| "tellraw".equalsIgnoreCase(arr[i + 1])
|
||||||
|
|| "title".equalsIgnoreCase(arr[i + 1])) {
|
||||||
|
command = parseCharCodes(command)
|
||||||
|
if (command.contains("selector")
|
||||||
|
|| command.contains("translate")) {
|
||||||
return "cancel";
|
return "cancel";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,6 +125,10 @@ public final class ServerCommand implements Listener {
|
||||||
if (command.contains("auto")) {
|
if (command.contains("auto")) {
|
||||||
return command.replace("auto", "[auto]");
|
return command.replace("auto", "[auto]");
|
||||||
}
|
}
|
||||||
|
if (command.contains("selector")
|
||||||
|
|| command.contains("translate")) {
|
||||||
|
return "cancel";
|
||||||
|
}
|
||||||
case "/minecraft:gamerule":
|
case "/minecraft:gamerule":
|
||||||
case "/gamerule":
|
case "/gamerule":
|
||||||
if (arr.length >= 3) {
|
if (arr.length >= 3) {
|
||||||
|
@ -158,9 +168,17 @@ public final class ServerCommand implements Listener {
|
||||||
return String.join(" ", arr);
|
return String.join(" ", arr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "/minecraft:bossbar":
|
||||||
|
case "/minecraft:setblock":
|
||||||
|
case "/minecraft:tellraw":
|
||||||
case "/minecraft:title":
|
case "/minecraft:title":
|
||||||
|
case "/bossbar":
|
||||||
|
case "/setblock":
|
||||||
|
case "/tellraw":
|
||||||
case "/title":
|
case "/title":
|
||||||
if (parseCharCodes(command).contains("selector")) {
|
command = parseCharCodes(command)
|
||||||
|
if (command.contains("selector")
|
||||||
|
|| command.contains("translate")) {
|
||||||
return "cancel";
|
return "cancel";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue