Skip to content
Permalink
Browse files

Allow user to specify biome map file

  • Loading branch information...
ferrybig committed Apr 9, 2019
1 parent da759f4 commit 313a9318093f52aa3be1926d1b1bd990932af74c
Showing with 19 additions and 1 deletion.
  1. +19 −1 src/main/java/me/ferrybig/java/minecraft/overview/mapper/Main.java
@@ -212,12 +212,21 @@ public static ProgramOptions parse(String[] args, ProgressReporter progressRepor
.hasArg()
.build();

Option biomeMap = Option
.builder("b")
.argName("biome-map")
.desc("Path to the biome map file")
.longOpt("biome-map")
.hasArg()
.build();

options.addOption(input);
options.addOption(output);
options.addOption(sequentional);
options.addOption(parallel);
options.addOption(minecraftDirectory);
options.addOption(texturePacks);
options.addOption(biomeMap);

CommandLineParser cmdParser = new DefaultParser();
CommandLine cmd;
@@ -234,6 +243,15 @@ public static ProgramOptions parse(String[] args, ProgressReporter progressRepor
return null;
}

System.out.println("Loading biome colors...");
BiomeMap map;
String mapFile = cmd.getOptionValue(biomeMap.getOpt());
if (mapFile == null) {
map = BiomeMap.loadDefault();
} else {
map = BiomeMap.load(new File(mapFile));
}

System.out.println("Loading textures...");
TextureParser parser = new TextureParser();
final List<Path> locateTexturePacks = locateTexturePacks(
@@ -242,7 +260,7 @@ public static ProgramOptions parse(String[] args, ProgressReporter progressRepor
);
locateTexturePacks.forEach(System.out::println);
parser.readAllPaths(locateTexturePacks);
final TextureCache textureCache = new TextureCache(parser, BiomeMap.loadDefault());
final TextureCache textureCache = new TextureCache(parser, map);

System.out.println("Initizing rendering system");
RegionRenderer renderer = new FlatImageRenderer(textureCache);

0 comments on commit 313a931

Please sign in to comment.
You can’t perform that action at this time.