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

查看:98
本文介绍了从命令行启动 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=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, however it does not go directly to the menu screen.

新方法(使用密码和用户名作为前缀)给我一条错误消息,说prefix -u=username or -p=password 不存在.

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%.minecraftin(或unixy系统上的~/.minecraft/bin)中,有一个minecraft.jar文件.这是真正的游戏 - 启动器运行它.

In %appdata%.minecraftin (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.

Here's an example of logging in to minecraft.net in C#.

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

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