Skip to content

Commit

Permalink
Fix TestBiomeMapCompatibility failing due to JsonUtils neeeding Slime…
Browse files Browse the repository at this point in the history
…fun to be loaded, add biome json for 1.20.5+
  • Loading branch information
md5sha256 committed Aug 11, 2024
1 parent 4ca732f commit d02dff9
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/**
* This test checks if biome maps work across multiple versions of Minecraft.
* A similar test can be written for Material Tags :?
*
*
* @author TheBusyBiscuit
*
*/
Expand All @@ -45,6 +45,9 @@ class TestBiomeMapCompatibility {
@BeforeAll
public static void load() {
MockBukkit.mock();
// Needed for JsonUtils.parseString which relies on a valid Slimefun plugin instance to determine the current
// MinecraftVersion
MockBukkit.load(Slimefun.class);

for (MinecraftVersion version : MinecraftVersion.values()) {
if (!version.isVirtual()) {
Expand Down Expand Up @@ -91,7 +94,7 @@ void testCompatibilities(String name, MinecraftVersion version) {

/**
* We manually specify here which biome map works on which minecraft versions.
*
*
* @return A {@link Stream} of {@link Arguments} for our unit test.
*/
private static @Nonnull Stream<Arguments> biomeMaps() {
Expand All @@ -105,37 +108,37 @@ void testCompatibilities(String name, MinecraftVersion version) {
MinecraftVersion.MINECRAFT_1_19,
MinecraftVersion.MINECRAFT_1_20
});

testCases.put("oil_v1.16", new MinecraftVersion[] {
MinecraftVersion.MINECRAFT_1_16,
MinecraftVersion.MINECRAFT_1_17
});

testCases.put("oil_v1.18", new MinecraftVersion[] {
MinecraftVersion.MINECRAFT_1_18,
MinecraftVersion.MINECRAFT_1_19,
MinecraftVersion.MINECRAFT_1_20
});

testCases.put("salt_v1.16", new MinecraftVersion[] {
MinecraftVersion.MINECRAFT_1_16,
MinecraftVersion.MINECRAFT_1_17
});

testCases.put("salt_v1.18", new MinecraftVersion[] {
MinecraftVersion.MINECRAFT_1_18,
MinecraftVersion.MINECRAFT_1_19,
MinecraftVersion.MINECRAFT_1_20
});

testCases.put("uranium_v1.16", new MinecraftVersion[] {
MinecraftVersion.MINECRAFT_1_16
});

testCases.put("uranium_v1.17", new MinecraftVersion[] {
MinecraftVersion.MINECRAFT_1_17
});

testCases.put("uranium_v1.18", new MinecraftVersion[] {
MinecraftVersion.MINECRAFT_1_18,
MinecraftVersion.MINECRAFT_1_19,
Expand Down
67 changes: 67 additions & 0 deletions src/test/resources/biomes/1.20.5+.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
"minecraft:ocean",
"minecraft:plains",
"minecraft:desert",
"minecraft:windswept_hills",
"minecraft:forest",
"minecraft:taiga",
"minecraft:swamp",
"minecraft:mangrove_swamp",
"minecraft:river",
"minecraft:nether_wastes",
"minecraft:the_end",
"minecraft:frozen_ocean",
"minecraft:frozen_river",
"minecraft:snowy_plains",
"minecraft:mushroom_fields",
"minecraft:beach",
"minecraft:jungle",
"minecraft:sparse_jungle",
"minecraft:deep_ocean",
"minecraft:stony_shore",
"minecraft:snowy_beach",
"minecraft:birch_forest",
"minecraft:dark_forest",
"minecraft:snowy_taiga",
"minecraft:old_growth_pine_taiga",
"minecraft:windswept_forest",
"minecraft:savanna",
"minecraft:savanna_plateau",
"minecraft:badlands",
"minecraft:wooded_badlands",
"minecraft:small_end_islands",
"minecraft:end_midlands",
"minecraft:end_highlands",
"minecraft:end_barrens",
"minecraft:warm_ocean",
"minecraft:lukewarm_ocean",
"minecraft:cold_ocean",
"minecraft:deep_lukewarm_ocean",
"minecraft:deep_cold_ocean",
"minecraft:deep_frozen_ocean",
"minecraft:the_void",
"minecraft:sunflower_plains",
"minecraft:windswept_gravelly_hills",
"minecraft:flower_forest",
"minecraft:ice_spikes",
"minecraft:old_growth_birch_forest",
"minecraft:old_growth_spruce_taiga",
"minecraft:windswept_savanna",
"minecraft:eroded_badlands",
"minecraft:bamboo_jungle",
"minecraft:soul_sand_valley",
"minecraft:crimson_forest",
"minecraft:warped_forest",
"minecraft:basalt_deltas",
"minecraft:dripstone_caves",
"minecraft:lush_caves",
"minecraft:deep_dark",
"minecraft:meadow",
"minecraft:grove",
"minecraft:snowy_slopes",
"minecraft:frozen_peaks",
"minecraft:jagged_peaks",
"minecraft:stony_peaks",
"minecraft:cherry_grove",
"minecraft:custom",
]

0 comments on commit d02dff9

Please sign in to comment.