Skip to content

Commit

Permalink
Add classpath back to server argfile
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jan 1, 2025
1 parent 03bacde commit d73dd91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ private String resolveClasspath() throws IOException {
classpathItems.add("libraries/net/minecraft/server/%s/server-%s-extra.jar".formatted(
getRawNeoFormVersion().get(), getRawNeoFormVersion().get()));

// Remove any java agents, since they automatically are on the classpath
classpathItems.removeAll(getJavaAgents().get());

// The raw server jar also contains its own classpath.
// We want to make sure that our versions of the libraries are used when there is a conflict.
var ourClasspathEntries = classpathItems.stream()
Expand Down Expand Up @@ -117,15 +120,11 @@ public void createArgsFile() throws IOException {
jvmOptions.add("-javaagent:" + javaAgent);
}

jvmOptions.add("-cp");
jvmOptions.add(resolveClasspath());

var replacements = new HashMap<String, String>();
replacements.put("@JVM_OPTIONS@", String.join("\n", jvmOptions));
replacements.put("@MODULE_PATH@", String.join(pathSeparator, getModules().get()));
replacements.put("@MODULES@", "ALL-MODULE-PATH");
replacements.put("@IGNORE_LIST@", String.join(",", getIgnoreList().get()));
replacements.put("@PLUGIN_LAYER_LIBRARIES@", "");
replacements.put("@GAME_LAYER_LIBRARIES@", "");
replacements.put("@CLASS_PATH@", resolveClasspath());
replacements.put("@TASK@", "neoforgeserver");
replacements.put("@FORGE_VERSION@", getNeoForgeVersion().get());
replacements.put("@FML_VERSION@", getFmlVersion().get());
replacements.put("@MC_VERSION@", getMinecraftVersion().get());
Expand Down
1 change: 0 additions & 1 deletion server_files/args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
-Djava.net.preferIPv6Addresses=system
-DlibraryDirectory=libraries
net.neoforged.fml.startup.Server
--launchTarget @TASK@
--fml.neoForgeVersion @FORGE_VERSION@
--fml.fmlVersion @FML_VERSION@
--fml.mcVersion @MC_VERSION@
Expand Down

0 comments on commit d73dd91

Please sign in to comment.