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

@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.11.7
# Mod Properties
mod_version = 0.2.8
mod_version = 0.2.9
maven_group = eu.midnightdust
archives_base_name = midnightlib

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