forked from kaboomserver/extras
Unblock selector even more (#327)
This commit is contained in:
parent
a1007853dd
commit
4a917201b4
1 changed files with 0 additions and 31 deletions
|
@ -135,9 +135,6 @@ 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")) {
|
|
||||||
return "cancel";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "/minecraft:give":
|
case "/minecraft:give":
|
||||||
case "/give":
|
case "/give":
|
||||||
|
@ -178,13 +175,6 @@ public final class ServerCommand implements Listener {
|
||||||
return String.join(" ", arr);
|
return String.join(" ", arr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "/minecraft:setblock":
|
|
||||||
case "/setblock":
|
|
||||||
final String charCommand = parseCharCodes(command);
|
|
||||||
if (charCommand.contains("selector")) {
|
|
||||||
return "cancel";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "/viaversion:viaver":
|
case "/viaversion:viaver":
|
||||||
case "/viaversion:viaversion":
|
case "/viaversion:viaversion":
|
||||||
case "/viaversion:vvbukkit":
|
case "/viaversion:vvbukkit":
|
||||||
|
@ -255,25 +245,4 @@ public final class ServerCommand implements Listener {
|
||||||
|
|
||||||
LOGGER.log(Level.INFO, "Console command: " + command);
|
LOGGER.log(Level.INFO, "Console command: " + command);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String parseCharCodes(final String input) {
|
|
||||||
if (input.contains("\\u")) {
|
|
||||||
StringBuilder output = new StringBuilder();
|
|
||||||
String[] split = input.split("\\\\u");
|
|
||||||
int index = 0;
|
|
||||||
for (String item:split) {
|
|
||||||
if (index == 0) {
|
|
||||||
output.append(item);
|
|
||||||
} else {
|
|
||||||
String charCode = item.substring(0, 4);
|
|
||||||
output.append((char) Integer.parseInt(charCode, 16));
|
|
||||||
output.append(item.substring(4));
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
return output.toString();
|
|
||||||
} else {
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue