Minecraft自定义启动器-Forge Mod Load [英] Minecraft custom launcher - forge mod load

查看:193
本文介绍了Minecraft自定义启动器-Forge Mod Load的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的世界制造发射器.

当我从工作空间(在C:/users/hugo/workspace中)启动它时,一切正常.

但是,当我从桌面运行启动器时,它将尝试从桌面中的所有文件夹加载mod.它还在桌面文件夹中创建了一个日志"文件夹.

我的启动命令(不加载库,也不生成后):

javaw -Xmx1024M -Xms1024M -XX:MaxPermSize=256M 
-Djava.library.path=C:\Users\Hugo\AppData\Roaming\Survival-Machines\game1\natives
-cp "C:\Users\Hugo\AppData...versions\1.7.10\1.7.10.jar;"
net.minecraft.launchwrapper.Launch
--tweakClass cpw.mods.fml.common.launcher.FMLTweaker
--username Slaynash
--version 1.7.10
--gameDir C:\Users\Hugo\AppData\Roaming\Survival-Machines\game1\
--assetsDir C:\Users\Hugo\AppData\Roaming\Survival-Machines\game1\assets
--assetIndex 1.7.10
--uuid 32********a3
--userProperties {}
--accessToken fa********cc

我使用Java和功能Runtime.getRuntime().exec(String cmd);

启动它

我的启动命令是否错误,或者我忘记了参数?

感谢您的帮助, 雨果

对不起,我的英语不好:/

解决方案

我认为它在启动命令中-我建议您对exec()方法使用另一种替代方法-一种允许您设置工作文件夹的方法. /p>

您当前的目录只是继承当前的工作目录,显然是桌面.

相反,请使用Runtime.getRuntime().exec(String cmd, String[] argp, File dir);

这可以让您告诉Java在哪里启动应用程序,该应用程序可能是包含您的mod的文件夹.

my launch command (without library load and after generation):

javaw -Xmx1024M -Xms1024M -XX:MaxPermSize=256M 
-Djava.library.path=C:\Users\Hugo\AppData\Roaming\Survival-Machines\game1\natives
-cp "C:\Users\Hugo\AppData...versions\1.7.10\1.7.10.jar;"
net.minecraft.launchwrapper.Launch
--tweakClass cpw.mods.fml.common.launcher.FMLTweaker
--username Slaynash
--version 1.7.10
--gameDir C:\Users\Hugo\AppData\Roaming\Survival-Machines\game1\
--assetsDir C:\Users\Hugo\AppData\Roaming\Survival-Machines\game1\assets
--assetIndex 1.7.10
--uuid 32********a3
--userProperties {}
--accessToken fa********cc

I launch it with java and function Runtime.getRuntime().exec(String cmd);

Is my launch command bad, or have i forgot an argument ?

Thanks for help, Hugo

and sorry for my bad english :/

解决方案

I think it's in the launch command - I suggest you use a different override of the exec() method - one that allows you to set the working folder.

Your current one just inherits the current working directory, evidently the desktop.

Instead, use Runtime.getRuntime().exec(String cmd, String[] argp, File dir);

This lets you tell java where to start the application, which will presumably be the folder that contains your mods.

https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exec(java.lang.String,%20java.lang.String[],%20java.io.File)

这篇关于Minecraft自定义启动器-Forge Mod Load的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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