运行 来自 Java args 的 exe(Minecraft 启动器)
Run exe from Java args (Minecraft Launcher)
我希望在 Minecraft 运行 从 MC 启动器启动时启动另一个应用程序,这样第二个应用程序就不需要打开或 运行 手动。我认为 Java args 可能是执行此操作的一种方法。这可行吗?
作为参考,这是默认的 java 参数:
"-Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"
是否有允许我 运行 exe 或执行 shell 命令的标志?
使用旧版 Minecraft 启动器(install guide), you can replace the launcher.jar
file in your %APPDATA%/Roaming/.minecraft
directory with your own custom Java application. Within your own application, you can do anything you like. To start Minecraft, you will have to start the original launcher.jar
yourself. This can be done through Runtime.exec(String[])
, or by including the launcher.jar
file as a dependency in your project and calling its main(String[])
method directly. Alternatively, you could write a batch script that starts both the Minecraft launcher and your application, or you could write a Minecraft Forge 客户端 mod 时,您可以在游戏开始后立即执行任何操作。
我希望在 Minecraft 运行 从 MC 启动器启动时启动另一个应用程序,这样第二个应用程序就不需要打开或 运行 手动。我认为 Java args 可能是执行此操作的一种方法。这可行吗?
作为参考,这是默认的 java 参数:
"-Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"
是否有允许我 运行 exe 或执行 shell 命令的标志?
使用旧版 Minecraft 启动器(install guide), you can replace the launcher.jar
file in your %APPDATA%/Roaming/.minecraft
directory with your own custom Java application. Within your own application, you can do anything you like. To start Minecraft, you will have to start the original launcher.jar
yourself. This can be done through Runtime.exec(String[])
, or by including the launcher.jar
file as a dependency in your project and calling its main(String[])
method directly. Alternatively, you could write a batch script that starts both the Minecraft launcher and your application, or you could write a Minecraft Forge 客户端 mod 时,您可以在游戏开始后立即执行任何操作。