问题描述
我想做一个简单的自定义Minecraft启动器的东西。
I'm trying to make a simple custom Minecraft launcher thing.
根据minecraft wiki的启动器页面:
,
应该可以从命令行使用用户名和密码作为前缀运行minecraft启动器,并直接进入游戏,而不是通过启动器。
According to minecraft wiki's Launcher page:http://www.minecraftwiki.net/wiki/Minecraft_launcher,it should be possible to run the minecraft launcher using username and password as prefix from the command line, and go directly to the game instead of through the launcher.
我尝试了各种版本的 java -cp -u = username -p = password minecraft.jar net.minecraft.LauncherFrame
,它说的是旧的方法:
I've tried various versions of java -cp -u=username -p=password minecraft.jar net.minecraft.LauncherFrame
, and what it says is the old method:
java -cp minecraft.jar net.minecraft.LauncherFrame <username> <password>
旧方法打开了Minecraft启动器,就像我双击jar文件一样。
The old method opens the minecraft launcher, just as if I double clicked the jar file. It does not go directly to the menu screen.
新的方式,使用密码和用户名作为前缀,只是给我一个错误信息,说前缀-u = username或-p =密码不存在
。
The new way, using password and username as prefix, just give me an error message saying the prefix -u=username or -p=password don't exist
.
有任何帮助吗?我真的很困惑:/
Any help on this? I'm really stuck :/
推荐答案
你可以这样做,你只需要绕过
You can do this, you just need to circumvent the launcher.
在%appdata%\.minecraft\bin
(或〜 /.minecraft/bin
在unixy系统上),有一个minecraft.jar文件。
In %appdata%\.minecraft\bin
(or ~/.minecraft/bin
on unixy systems), there is a minecraft.jar file. This is the actual game - the launcher runs this.
这样调用:
java -Xms512m -Xmx1g -Djava.library.path=natives/ -cp "minecraft.jar;lwjgl.jar;lwjgl_util.jar" net.minecraft.client.Minecraft <username> <sessionID>
将工作目录设置为 .minecraft / bin
。
要获取会话ID,POST(请求此页面):
To get the session ID, POST (request this page):
https://login.minecraft.net?user=<username>&password=<password>&version=13
您会得到如下响应:
1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98
第四个字段是会话ID。 。 阅读这些详细信息,此答案已过时
The fourth field is the session ID. More details here. Read those details, this answer is outdated
,并且。
这篇关于从命令行启动Minecraft - usename和密码作为前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!