Block the /execute ... run datapack command (#361)

* Block the /execute ... run datapack command

The /datapack list command is useless, and the other 2 subcommands (/datapack enable and /datapack disable) can be used to cause huge lag on the server.

* Update ServerCommand.java (partial revert)
This commit is contained in:
GEOEGII555 2024-09-11 02:19:56 +03:00 committed by GitHub
parent 7450b8bcc9
commit 3278ddaddc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,7 @@ public final class ServerCommand implements Listener {
private static final Pattern SELECTOR_PATTERN = Pattern.compile("(?>\\s)*@[aepsr](?>\\s)*"); private static final Pattern SELECTOR_PATTERN = Pattern.compile("(?>\\s)*@[aepsr](?>\\s)*");
private static final Logger LOGGER = JavaPlugin.getPlugin(Main.class).getLogger(); private static final Logger LOGGER = JavaPlugin.getPlugin(Main.class).getLogger();
private static final String[] COMMANDS = { "execute", "clone", "fill", "forceload", "kick", private static final String[] COMMANDS = { "execute", "clone", "datapack", "fill", "forceload", "kick",
"locate", "locatebiome", "me", "msg", "reload", "save-all", "say", "spreadplayers", "locate", "locatebiome", "me", "msg", "reload", "save-all", "say", "spreadplayers",
"stop", "summon", "teammsg", "teleport", "tell", "tellraw", "tm", "tp", "w", "place", "stop", "summon", "teammsg", "teleport", "tell", "tellraw", "tm", "tp", "w", "place",
"fillbiome", "ride" , "tick", "jfr"}; "fillbiome", "ride" , "tick", "jfr"};