从命令行启动Minecraft - 用户名和密码作为前缀 [英] Launch Minecraft from command line - username and password as prefix

查看:196
本文介绍了从命令行启动Minecraft - 用户名和密码作为前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个简单的定制Minecraft发射器的东西。

I'm trying to make a simple custom Minecraft launcher thing.

根据发射器的Minecraft Wiki页面
应该可以使用命令行中的用户名和密码前缀运行Minecraft启动器,直接转到游戏而不是通过启动器。

According to the Minecraft Wiki page for the Launcher, it should be possible to run the Minecraft launcher using username and password prefixes from the command line and go directly to the game instead of through the launcher.

我尝试过各种版本的 java -cp -u = username -p =密码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, however it does not go directly to the menu screen.

新的方法(使用密码和用户名作为前缀),给我一条错误信息,说明前缀 - u =用户名或-p =密码不存在

The new way (using password and username as prefix), gives 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

这是一个用C#登录minecraft.net的示例,以及启动minecraft.jar的示例

这篇关于从命令行启动Minecraft - 用户名和密码作为前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆