Skip to content

Commit

Permalink
Fix map generator with random biome
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Jan 9, 2024
1 parent 5067d5e commit 2bfdc24
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Expand Up @@ -95,7 +95,7 @@ public List<String> getCommand() {
command.addAll(Arrays.asList("--reclaim-density", reclaimDensity.toString()));
}

if (biome != null) {
if (biome != null && !biome.equals(MapGeneratorService.GENERATOR_RANDOM_BIOME)) {
command.addAll(Arrays.asList("--biome", biome));
}

Expand Down
Expand Up @@ -8,6 +8,9 @@
import java.nio.file.Path;
import java.util.List;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.not;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -146,6 +149,18 @@ public void testBiomeSet() {
assertTrue(command.containsAll(List.of("--biome", "TEST")));
}

@Test
public void testRandomStyleSet() {
List<String> command = defaultBuilder().style("RANDOM").build().getCommand();
assertThat(command, not(contains("--style")));
}

@Test
public void testRandomBiomeSet() {
List<String> command = defaultBuilder().biome("RANDOM").build().getCommand();
assertThat(command, not(contains("--biome")));
}

@Test
public void testCommandArgsSet() {
List<String> command = defaultBuilder().commandLineArgs("--help").build().getCommand();
Expand Down

0 comments on commit 2bfdc24

Please sign in to comment.