package wtf.hak.survivalfabric.commands; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.context.CommandContext; import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; import wtf.hak.survivalfabric.config.ConfigManager; public class ReloadConfigCommand { public static void register(CommandDispatcher dispatcher, String... aliases) { for (String str : aliases) dispatcher.register(CommandManager.literal(str) .requires(source -> source.hasPermissionLevel(2)) .executes(ReloadConfigCommand::execute)); } private static int execute(CommandContext context) { ConfigManager.load(); return 1; } }