Add paper-settings-directory cl argument (#7949)

This commit is contained in:
Nassim Jahnke 2022-06-12 10:07:43 +02:00
parent 9c10476c94
commit 8d1748a6f9
2 changed files with 10 additions and 3 deletions

View File

@ -47,4 +47,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ GameProfileCache gameProfileCache = new GameProfileCache(gameProfileRepository, userCacheFile); // Paper
SignatureValidator signatureValidator = SignatureValidator.from(authenticationService.getServicesKey());
// Paper start
io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(((File) optionSet.valueOf("paper-settings")).toPath(), java.nio.file.Path.of(io.papermc.paper.configuration.PaperConfigurations.CONFIG_DIR), rootDirectory.toPath(), (File) optionSet.valueOf("spigot-settings"));
final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();

View File

@ -4123,7 +4123,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
SignatureValidator signatureValidator = SignatureValidator.from(authenticationService.getServicesKey());
- return new Services(minecraftSessionService, signatureValidator, gameProfileRepository, gameProfileCache);
+ // Paper start
+ io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(((File) optionSet.valueOf("paper-settings")).toPath(), java.nio.file.Path.of(io.papermc.paper.configuration.PaperConfigurations.CONFIG_DIR), rootDirectory.toPath(), (File) optionSet.valueOf("spigot-settings"));
+ final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();
+ final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath();
+ io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(legacyConfigPath, configDirPath, rootDirectory.toPath(), (File) optionSet.valueOf("spigot-settings"));
+ return new Services(minecraftSessionService, signatureValidator, gameProfileRepository, gameProfileCache, paperConfigurations);
+ // Paper end
}
@ -4206,7 +4208,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Spigot End
+
+ // Paper Start
+ acceptsAll(asList("paper", "paper-settings"), "File for paper settings")
+ acceptsAll(asList("paper-dir", "paper-settings-directory"), "Directory for Paper settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File(io.papermc.paper.configuration.PaperConfigurations.CONFIG_DIR))
+ .describedAs("Config directory");
+ acceptsAll(asList("paper", "paper-settings"), "File for Paper settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("paper.yml"))