diff --git a/src/main/java/com/iridium/iridiumskyblock/generators/VoidGenerator.java b/src/main/java/com/iridium/iridiumskyblock/generators/VoidGenerator.java index e9e9a84a1..554032dea 100644 --- a/src/main/java/com/iridium/iridiumskyblock/generators/VoidGenerator.java +++ b/src/main/java/com/iridium/iridiumskyblock/generators/VoidGenerator.java @@ -16,6 +16,17 @@ public class VoidGenerator extends ChunkGenerator { public byte[][] blockSections; + @Override + public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, @NotNull BiomeGrid biomeGrid) { + final ChunkData chunkData = createChunkData(world); + for (int x = 0; x < 16; x++) { + for (int z = 0; z < 16; z++) { + biomeGrid.setBiome(x, z, Objects.requireNonNull(getSkyblockGenerator(world.getEnvironment()).biome.getBiome())); + } + } + return chunkData; + } + public byte[][] generateBlockSections(World world, Random random, int x, int z, BiomeGrid biomeGrid) { if (blockSections == null) { blockSections = new byte[world.getMaxHeight() / 16][]; diff --git a/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java b/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java index dac819325..5a44dde2b 100644 --- a/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java +++ b/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java @@ -78,6 +78,7 @@ public void createWorld(World.Environment environment, String name) { WorldCreator worldCreator = new WorldCreator(name) .generator(IridiumSkyblock.getInstance().getDefaultWorldGenerator(name, null)) .environment(environment); + World world = Bukkit.createWorld(worldCreator); createCacheWorld(world); @@ -111,14 +112,8 @@ public void createCacheWorld(World world) { if(!IridiumSkyblock.getInstance().getConfiguration().generatorType.isTerrainGenerator()) return; - if (Bukkit.getWorld(getCacheWorldName(world)) == null) { - - WorldCreator worldCreator = new WorldCreator(getCacheWorldName(world)) - .generator(IridiumSkyblock.getInstance().getDefaultWorldGenerator(world.getName(), null)) - .environment(world.getEnvironment()) - .seed(world.getSeed()); - + WorldCreator worldCreator = new WorldCreator(getCacheWorldName(world)).copy(world); worldCreator.createWorld(); } @@ -403,8 +398,7 @@ public void regenerateTerrain (Island island, World world, int y, CompletableFut for (int z = pos1.getBlockZ(); z <= pos2.getBlockZ(); z++) { Block blockA = regenWorld.getBlockAt(x, y, z); Block blockB = world.getBlockAt(x, y, z); - - blockB.setType(blockA.getType(), false); + blockB.setBlockData(blockA.getBlockData(), false); } }