diff options
| author | 2025-09-11 17:35:30 +0100 | |
|---|---|---|
| committer | 2025-09-13 09:14:23 +0100 | |
| commit | f8c7b8497e9687e15123caca7d4fde54f5bf067a (patch) | |
| tree | 92a9da7756e0e18cb8925c1cc01e2a2edc10e60f /enigma-server/src/main | |
| parent | Add factory methods to the entry views (diff) | |
| download | enigma-fork-f8c7b8497e9687e15123caca7d4fde54f5bf067a.tar.gz enigma-fork-f8c7b8497e9687e15123caca7d4fde54f5bf067a.tar.xz enigma-fork-f8c7b8497e9687e15123caca7d4fde54f5bf067a.zip | |
Allow you to specify the libraries in the program args rather than always using the runtime classpath
Diffstat (limited to 'enigma-server/src/main')
| -rw-r--r-- | enigma-server/src/main/java/cuchaz/enigma/network/DedicatedEnigmaServer.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/enigma-server/src/main/java/cuchaz/enigma/network/DedicatedEnigmaServer.java b/enigma-server/src/main/java/cuchaz/enigma/network/DedicatedEnigmaServer.java index a3c3882..24fd9ff 100644 --- a/enigma-server/src/main/java/cuchaz/enigma/network/DedicatedEnigmaServer.java +++ b/enigma-server/src/main/java/cuchaz/enigma/network/DedicatedEnigmaServer.java | |||
| @@ -21,7 +21,6 @@ import cuchaz.enigma.Enigma; | |||
| 21 | import cuchaz.enigma.EnigmaProfile; | 21 | import cuchaz.enigma.EnigmaProfile; |
| 22 | import cuchaz.enigma.EnigmaProject; | 22 | import cuchaz.enigma.EnigmaProject; |
| 23 | import cuchaz.enigma.ProgressListener; | 23 | import cuchaz.enigma.ProgressListener; |
| 24 | import cuchaz.enigma.classprovider.ClasspathClassProvider; | ||
| 25 | import cuchaz.enigma.translation.mapping.EntryRemapper; | 24 | import cuchaz.enigma.translation.mapping.EntryRemapper; |
| 26 | import cuchaz.enigma.translation.mapping.serde.MappingFormat; | 25 | import cuchaz.enigma.translation.mapping.serde.MappingFormat; |
| 27 | import cuchaz.enigma.translation.mapping.serde.MappingParseException; | 26 | import cuchaz.enigma.translation.mapping.serde.MappingParseException; |
| @@ -58,6 +57,8 @@ public class DedicatedEnigmaServer extends EnigmaServer { | |||
| 58 | 57 | ||
| 59 | OptionSpec<Path> jarOpt = parser.accepts("jar", "Jar file to open at startup; if there are multiple jars, the order must be the same between the server and all clients").withRequiredArg().required().withValuesConvertedBy(PathConverter.INSTANCE); | 58 | OptionSpec<Path> jarOpt = parser.accepts("jar", "Jar file to open at startup; if there are multiple jars, the order must be the same between the server and all clients").withRequiredArg().required().withValuesConvertedBy(PathConverter.INSTANCE); |
| 60 | 59 | ||
| 60 | OptionSpec<Path> librariesOpt = parser.accepts("library", "Library file used by the jar").withRequiredArg().withValuesConvertedBy(PathConverter.INSTANCE); | ||
| 61 | |||
| 61 | OptionSpec<Path> mappingsOpt = parser.accepts("mappings", "Mappings file to open at startup").withRequiredArg().required().withValuesConvertedBy(PathConverter.INSTANCE); | 62 | OptionSpec<Path> mappingsOpt = parser.accepts("mappings", "Mappings file to open at startup").withRequiredArg().required().withValuesConvertedBy(PathConverter.INSTANCE); |
| 62 | 63 | ||
| 63 | OptionSpec<Path> profileOpt = parser.accepts("profile", "Profile json to apply at startup").withRequiredArg().withValuesConvertedBy(PathConverter.INSTANCE); | 64 | OptionSpec<Path> profileOpt = parser.accepts("profile", "Profile json to apply at startup").withRequiredArg().withValuesConvertedBy(PathConverter.INSTANCE); |
| @@ -91,7 +92,7 @@ public class DedicatedEnigmaServer extends EnigmaServer { | |||
| 91 | EnigmaProfile profile = EnigmaProfile.read(profileFile); | 92 | EnigmaProfile profile = EnigmaProfile.read(profileFile); |
| 92 | Enigma enigma = Enigma.builder().setProfile(profile).build(); | 93 | Enigma enigma = Enigma.builder().setProfile(profile).build(); |
| 93 | System.out.println("Indexing Jar..."); | 94 | System.out.println("Indexing Jar..."); |
| 94 | EnigmaProject project = enigma.openJars(jars, new ClasspathClassProvider(), ProgressListener.none()); | 95 | EnigmaProject project = enigma.openJars(jars, parsedArgs.valuesOf(librariesOpt), ProgressListener.none()); |
| 95 | 96 | ||
| 96 | MappingFormat mappingFormat = MappingFormat.ENIGMA_DIRECTORY; | 97 | MappingFormat mappingFormat = MappingFormat.ENIGMA_DIRECTORY; |
| 97 | EntryRemapper mappings; | 98 | EntryRemapper mappings; |