Skip to content

Commit

Permalink
fixed null world on biome set
Browse files Browse the repository at this point in the history
  • Loading branch information
sh0inx committed Dec 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent a3fa3fc commit 1d6ea92
Showing 1 changed file with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -84,20 +84,16 @@ public void createWorld(World.Environment environment, String name) {
}

public void setIslandBiome(@NotNull Island island, @NotNull XBiome biome) {
World.Environment environment = biome.getEnvironment();

World.Environment dimension = biome.getEnvironment();
World world;
switch (environment) {
case NETHER:
world = getWorld(World.Environment.NETHER);
break;
case THE_END:
world = getWorld(World.Environment.THE_END);
break;
default:
world = getWorld(World.Environment.NORMAL);
break;

if(!IridiumSkyblock.getInstance().getConfiguration().enabledWorlds.containsKey(dimension)) {
return;
}

world = getWorld(dimension);

getIslandChunks(island).thenAccept(chunks -> {
Location pos1 = island.getPosition1(world);
Location pos2 = island.getPosition2(world);
@@ -231,9 +227,23 @@ public CompletableFuture<Void> generateIsland(Island island, Schematics.Schemati
setHome(island, schematicConfig);
deleteIslandBlocks(island).join();
IridiumSkyblock.getInstance().getSchematicManager().pasteSchematic(island, schematicConfig).join();
setIslandBiome(island, XBiome.matchXBiome(schematicConfig.overworld.biome));
setIslandBiome(island, XBiome.matchXBiome(schematicConfig.nether.biome));
setIslandBiome(island, XBiome.matchXBiome(schematicConfig.end.biome));

for(Map.Entry<World.Environment, Boolean> enabledWorld : IridiumSkyblock.getInstance().getConfiguration().enabledWorlds.entrySet()) {
if(!enabledWorld.getValue()) {
continue;
}

switch (enabledWorld.getKey()) {
case NETHER:
setIslandBiome(island, XBiome.matchXBiome(schematicConfig.nether.biome));
break;
case THE_END:
setIslandBiome(island, XBiome.matchXBiome(schematicConfig.end.biome));
break;
default:
setIslandBiome(island, XBiome.matchXBiome(schematicConfig.overworld.biome));
}
}
});
}

0 comments on commit 1d6ea92

Please sign in to comment.