Unblock selector even more (#327)

This commit is contained in:
Chipmunk 2022-11-04 22:11:40 +00:00 committed by GitHub
parent a1007853dd
commit 4a917201b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}
} }