为 Prism Launcher 添加外置登录 (Authlib Injector) 功能

2023-06-15 19:42:22 +08:00
 baobao1270

不知道有没有小伙伴使用 Prism Launcher ,而常玩的服务器却需要使用 Authlib Injector 登录的。

这个功能国内的启动器大多支持,但是 Prism Launcher 的上游 MultiMC 表示永远不会支持这个功能。而 Prism Launcher 似乎也没有支持的计划。

我这里提供一个小脚本,可以让 Prism Launcher 支持外置登录。

仅限 Linux / macOS 使用。

依赖

您的设备应该存在 /dev/urandom

如果是 macOS 用户,以上依赖必须使用 Homebrew 安装。

安装

git clone https://github.com/baobao1270/mmcai.sh.git
mg mmcai.sh ~/.mmcai.sh
cd ~/.mmcai.sh
chmod +x mmcai-login
chmod +x mmcai-launch-minecraft

以下所有说明假设您将 mmcai.sh 安装到 ~/.mmcai.sh。如果您安装到其他位置,请自行替换。

登录

$ cd ~/.mmcai.sh
$ ./mmcai-login https://skim.mc.example.com/api/yggdrasil
Using server endpoint: https://skim.mc.example.com/api/yggdrasil
Waiting for server response...
Server name: Blessing Skin 皮肤站
Note: when entering password, there is no echo on the screen.
Username: Luo_Tianyi
Password:
Getting client token...
1+0 records in
1+0 records out
512 bytes transferred in 0.000074 secs (6918919 bytes/sec)
Login Success!

注意输入密码时没有回显。

启动 Minecraft

在 MultiMC / Prism Launcher 中,编辑实例,选择「设置」——「自定义命令」,填写「包装器命令」为:

~/.mmcai.sh/mmcai-launch-minecraft

其中,将 ~ 替换为你的 Home 目录的绝对路径。

2030 次点击
所在节点    分享创造
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://ex.noerr.eu.org/t/949079

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX