简体   繁体   English

我的世界自定义启动器,如何跳过主菜单直接进入游戏世界

[英]minecraft custom launcher, how to skip main menu and go directly into game world

I want to make my own custom launcher for minecraft, where player selects single player mode or multiplayer mode inside launcher instead of game main menu.我想为我的世界制作我自己的自定义启动器,玩家可以在启动器中选择单人游戏模式或多人游戏模式,而不是游戏主菜单。 And when player launches minecraft, it goes directly into game world without showing the main menu.当玩家启动我的世界时,它会直接进入游戏世界而不显示主菜单。

How could I achieve this kind of function?我怎样才能实现这种功能? I am new to minecraft development, but I have experience with java programming.我是 Minecraft 开发的新手,但我有 Java 编程经验。 Should I use bukkit to make this happen?我应该使用 bukkit 来实现这一目标吗? Or use forge to create a mod?或者使用forge创建一个mod?

Many thanks in advance.提前谢谢了。

It's not possible to join a singleplayer world directly just from a launcher (without changing game code through the launcher).仅从启动器(不通过启动器更改游戏代码)直接加入单人游戏世界是不可能的。

However, the game does accept an argument to connect to a server upon joining;但是,游戏确实接受在加入时连接到服务器的参数; you can do this by passing a --server <server> and --port <port> argument when launching the jar.您可以通过在启动 jar 时传递--server <server>--port <port>参数来完成此操作。 If those arguments are present then the game will connect to that server rather than displaying the main menu.如果存在这些参数,则游戏将连接到该服务器而不是显示主菜单。 To actually make use of those arguments you'll need to have written the rest of your launcher, since the game only launches when you can give those parameters.要实际使用这些参数,您需要编写启动器的其余部分,因为游戏仅在您可以提供这些参数时启动。

This is a fairly difficult task to begin with...这是一个相当困难的任务开始...
First of all minecraft is structured in a way that the game (minecraft) is separed from the launcher so you would need some communication between your custom launcher and the game.首先,我的世界的结构是将游戏(我的世界)与启动器分开,因此您需要在自定义启动器和游戏之间进行一些通信。
So the best solution that I can think of is to create a mod that attaches to the game and reads something external like a file (created by the launcher) which has the data to launch directly or not the game.所以我能想到的最好的解决方案是创建一个附加到游戏的 mod 并读取外部文件(由启动器创建),该文件具有直接启动或不启动游戏的数据。
Bukkit is a completely different thing because it works on the server side of minecraft (multiplayer) and it doesn't affect the launch of the game at all. Bukkit 是一个完全不同的东西,因为它在我的世界(多人游戏)的服务器端工作,它根本不影响游戏的启动。

Anyways this isn't the best place to talk about minecraft mods, there are specialized forums like Forge forums that could help you a lot better than what I can do.无论如何,这不是谈论我的世界模组的最佳场所,有像Forge 论坛这样的专业论坛可以比我能做的更好地帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM