问题描述
我有一个问题,我试图使用我以前的编程知识写一个Minecraft启动器。我使用的标准C ++库中的命令和任何不是巨大的Python鸡蛋。我更喜欢使用 system(java ...)
以启动Minecraft。
I have an issue where I am trying to use my previous knowledge of programming to write a Minecraft launcher. I have use of commands that are in the standard C++ libraries and any Python eggs that are not huge. I would prefer to use system("java ...")
in order to launch Minecraft.
简而言之:
如何从命令行启动Minecraft,没有任何辅助Java代码? (不使用如 net.minecraft.LauncherFrame
的启动器代码)是可能吗?我尝试了 java -cp mine craft.jar net.minecraft.client.Minecraft
从终端在Mac OS X,没有效果,以一个 ClassNotFoundException
。
The question in short:How do I launch Minecraft from the command line without any auxillary Java code? (Without using launcher code like net.minecraft.LauncherFrame
) Is it possible? I tried java -cp mine craft.jar net.minecraft.client.Minecraft
from the Terminal in Mac OS X, to no avail, ending with a ClassNotFoundException
.
任何人都可以了解我的问题吗?
谢谢你,
Pyro。
Can anyone shed some light on my problem?Thank you,Pyro.
推荐答案
我在linux上运行,但这也应该工作for you:
I'm running on linux, but this also should work for you:
java -cp ".minecraft/bin/*" -Djava.library.path=".minecraft/bin/natives/" net.minecraft.client.Minecraft "username" "login id"
您可以在此处获取您的登录ID:
You can get your login id here: https://login.minecraft.net?user=<username>&password=<password>&version=13
有关身份验证方案的详情
More info about the authentication scheme here
UPDATE:
minecraft 1.6的新启动器更改了很多。
对于启动命令,您应该查看 .minecraft / versions /< version> /< version> .json
身份验证也已更改。它现在使用POST参数并返回JSON。有关详情,请。
这篇关于从命令行Python / C ++启动Minecraft的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!