Skip to content

Commit

Permalink
CLI: Support for passing a custom mods folder path (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnicJelle authored Oct 12, 2024
1 parent f5e36ad commit b30cc4d
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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");
Expand All @@ -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"))
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b30cc4d

Please sign in to comment.