mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-25 12:05:13 +01:00
CLI: Support for passing a custom mods folder path (#617)
This commit is contained in:
parent
f5e36ad923
commit
b30cc4d868
@ -72,6 +72,7 @@ public class BlueMapCLI {
|
||||
|
||||
private String minecraftVersion = null;
|
||||
private Path configFolder = Path.of("config");
|
||||
private Path modsFolder = null;
|
||||
|
||||
|
||||
public void renderMaps(BlueMapService blueMap, boolean watch, Predicate<TileState> force, boolean forceGenerateWebapp,
|
||||
@ -318,6 +319,14 @@ public static void main(String[] args) {
|
||||
FileHelper.createDirectories(cli.configFolder);
|
||||
}
|
||||
|
||||
//mods folder
|
||||
if (cmd.hasOption("n")) {
|
||||
cli.modsFolder = Path.of(cmd.getOptionValue("n"));
|
||||
if (!Files.isDirectory(cli.modsFolder)) {
|
||||
throw new ConfigurationException("Mods folder does not exist: " + cli.modsFolder);
|
||||
}
|
||||
}
|
||||
|
||||
//minecraft version
|
||||
if (cmd.hasOption("v")) {
|
||||
cli.minecraftVersion = cmd.getOptionValue("v");
|
||||
@ -332,6 +341,7 @@ public static void main(String[] args) {
|
||||
BlueMapConfigManager configs = BlueMapConfigManager.builder()
|
||||
.minecraftVersion(cli.minecraftVersion)
|
||||
.configRoot(cli.configFolder)
|
||||
.modsFolder(cli.modsFolder)
|
||||
.usePluginConfig(false)
|
||||
.defaultDataFolder(Path.of("data"))
|
||||
.defaultWebroot(Path.of("web"))
|
||||
@ -435,6 +445,15 @@ private static Options createOptions() {
|
||||
.build()
|
||||
);
|
||||
|
||||
options.addOption(
|
||||
Option.builder("n")
|
||||
.longOpt("mods")
|
||||
.hasArg()
|
||||
.argName("mods-folder")
|
||||
.desc("Sets path of the folder containing the mods that contain extra resources for rendering.")
|
||||
.build()
|
||||
);
|
||||
|
||||
options.addOption(
|
||||
Option.builder("v")
|
||||
.longOpt("mc-version")
|
||||
|
Loading…
Reference in New Issue
Block a user