Skip to content

Commit

Permalink
code adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7d8 committed Apr 23, 2024
1 parent 076d4c5 commit 054d039
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ jobs:
tag_name: ${{ steps.get-version-id.outputs.id }}
draft: false
prerelease: false
permissions: write
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import dev.mcvapi.neoforgeserverjar.server.ServerBootstrap;
import dev.mcvapi.neoforgeserverjar.utils.ErrorReporter;

import java.io.*;
import java.io.File;
import java.lang.management.ManagementFactory;

public class NeoForgeServerJAR {
Expand All @@ -28,15 +28,15 @@ public static void main(final String[] args) {
ErrorReporter.error("09", true);
}

// Server startup
String[] vmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments().toArray(new String[0]);
String[] cmd = new String[vmArgs.length + 2];
cmd[0] = "java";

System.arraycopy(vmArgs, 0, cmd, 1, vmArgs.length);

boolean windows = System.getProperty("os.name").startsWith("Windows");
cmd[1 + vmArgs.length] = "@libraries/net/neoforged/neoforge/" + forgeVersion + "/" + (windows ? "win" : "unix") + "_args.txt";
cmd[1 + vmArgs.length] = "@libraries/net/neoforged/neoforge/" + forgeVersion + "/" + (windows ? "win" : "unix")
+ "_args.txt";

try {
new ServerBootstrap().startServer(cmd);
Expand Down

0 comments on commit 054d039

Please sign in to comment.