MidnightLib 0.2.9 - Make /midnightconfig command only able to be executed by operators

This commit is contained in:
Motschen
2021-10-29 11:16:21 +02:00
parent afa8cf9a5d
commit 78dcb1e988
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ public class AutoCommand {
public void register() {
command = CommandManager.literal(modid);
command();
LiteralArgumentBuilder<ServerCommandSource> finalized = CommandManager.literal("midnightconfig").then(command);
LiteralArgumentBuilder<ServerCommandSource> finalized = CommandManager.literal("midnightconfig").requires(source -> source.hasPermissionLevel(2)).then(command);
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(finalized));
}