Option to blacklist all commands (#138)

* Option to blacklist all commands

* blacklist all commands by default

---------

Co-authored-by: William <will27528@gmail.com>
feat/data-edit-commands
kFor 2 years ago committed by GitHub
parent bbcb091daf
commit c306d700ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -178,7 +178,7 @@ public class BukkitEventListener extends EventListener implements BukkitJoinEven
String[] commandArgs = event.getMessage().substring(1).split(" ");
String commandLabel = commandArgs[0].toLowerCase(Locale.ENGLISH);
if (blacklistedCommands.contains(commandLabel)) {
if (blacklistedCommands.contains("*") || blacklistedCommands.contains(commandLabel)) {
event.setCancelled(cancelPlayerEvent(event.getPlayer().getUniqueId()));
}
}

@ -132,7 +132,7 @@ public class Settings {
private Map<String, Boolean> synchronizationFeatures = SynchronizationFeature.getDefaults();
@YamlKey("synchronization.blacklisted_commands_while_locked")
private List<String> blacklistedCommandsWhileLocked = new ArrayList<>();
private List<String> blacklistedCommandsWhileLocked = new ArrayList<>(List.of("*"));
@YamlKey("synchronization.event_priorities")
private Map<String, String> synchronizationEventPriorities = EventType.getDefaults();

Loading…
Cancel
Save