[FIX] ServerWrapper config args

This commit is contained in:
Gravita 2022-05-11 22:05:34 +07:00
parent 95704fc1bf
commit 5d332a10b5

View file

@ -156,7 +156,9 @@ public void run(String... args) throws Throwable {
LogHelper.info("ServerWrapper: LaunchServer address: %s. Title: %s", config.address, Launcher.profile != null ? Launcher.profile.getTitle() : "unknown"); LogHelper.info("ServerWrapper: LaunchServer address: %s. Title: %s", config.address, Launcher.profile != null ? Launcher.profile.getTitle() : "unknown");
LogHelper.info("Minecraft Version (for profile): %s", wrapper.profile == null ? "unknown" : wrapper.profile.getVersion().name); LogHelper.info("Minecraft Version (for profile): %s", wrapper.profile == null ? "unknown" : wrapper.profile.getVersion().name);
String[] real_args; String[] real_args;
if (args.length > 0) { if(config.args != null && config.args.size() > 0) {
real_args = config.args.toArray(new String[0]);
} else if (args.length > 0) {
real_args = new String[args.length - 1]; real_args = new String[args.length - 1];
System.arraycopy(args, 1, real_args, 0, args.length - 1); System.arraycopy(args, 1, real_args, 0, args.length - 1);
} else real_args = args; } else real_args = args;