Skip to content

Commit

Permalink
Fix #36
Browse files Browse the repository at this point in the history
  • Loading branch information
piegamesde committed Mar 11, 2020
1 parent 0b3ddcb commit 2a0c376
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ public boolean needsCaching() {
}

public Path getPath(Vector2ic pos) {
return getSibling(basePath, regions.get(pos).image);
if (regions.containsKey(pos))
return getSibling(basePath, regions.get(pos).image);
else
return null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@ public void test() throws IOException {
"--max-X=1024", "--min-Z=-1024", "--max-Z=1024",
"--dimension=OVERWORLD"));

assertEquals(0, CommandLineMain.mainWithoutQuit("-v", "render", "--create-tile-html", "--lazy", "-o=" + out2 + "/", "./src/main/resources/BlockMapWorld/", "--min-X=1024",
assertEquals(2, CommandLineMain.mainWithoutQuit("-v", "render", "--create-tile-html", "--lazy", "-o=" + out2 + "/", "./src/main/resources/BlockMapWorld/", "--min-X=1024",
"--max-X=1024", "--min-Z=1024", "--max-Z=1024",
"--dimension=OVERWORLD"));
}

/** Regression test for {@link https://github.com/Minecraft-Technik-Wiki/BlockMap/issues/36} */
@Test
public void test2() throws IOException {
File out3 = folder.newFolder();
assertEquals(0, CommandLineMain.mainWithoutQuit("-v", "render", "--create-tile-html", "-o", out3.toString(), "./src/main/resources/BlockMapWorld2/",
"-d", "OVERWORLD"));
}

/**
* Test the bounds on {@link PostProcessing#createTileHtml(RegionFolder, java.nio.file.Path, de.piegames.blockmap.renderer.RenderSettings)}
* and {@link PostProcessing#createBigImage(RegionFolder, java.nio.file.Path, de.piegames.blockmap.renderer.RenderSettings)}.
Expand Down

0 comments on commit 2a0c376

Please sign in to comment.