From c2015848b0314bc67db37ca23e88b1d7baa5c833 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 13 Aug 2021 22:08:18 +0300 Subject: [PATCH] More fixes --- .../world/generator/BCLibEndBiomeSource.java | 31 ++++++++++--------- .../generator/BCLibNetherBiomeSource.java | 20 ++++++------ 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/main/java/ru/bclib/world/generator/BCLibEndBiomeSource.java b/src/main/java/ru/bclib/world/generator/BCLibEndBiomeSource.java index 4fa936ae..8532f942 100644 --- a/src/main/java/ru/bclib/world/generator/BCLibEndBiomeSource.java +++ b/src/main/java/ru/bclib/world/generator/BCLibEndBiomeSource.java @@ -42,19 +42,6 @@ public class BCLibEndBiomeSource extends BiomeSource { public BCLibEndBiomeSource(Registry biomeRegistry, long seed) { super(getBiomes(biomeRegistry)); - BiomeAPI.END_LAND_BIOME_PICKER.clearMutables(); - BiomeAPI.END_VOID_BIOME_PICKER.clearMutables(); - biomeRegistry.forEach(biome -> { - ResourceLocation key = biomeRegistry.getKey(biome); - BCLBiome bclBiome = BiomeAPI.getBiome(key); - bclBiome.updateActualBiomes(biomeRegistry); - if (!BiomeAPI.END_LAND_BIOME_PICKER.containsImmutable(key)) { - BiomeAPI.END_LAND_BIOME_PICKER.addBiomeMutable(bclBiome); - } - }); - BiomeAPI.END_LAND_BIOME_PICKER.rebuild(); - BiomeAPI.END_VOID_BIOME_PICKER.rebuild(); - this.mapLand = new BiomeMap(seed, GeneratorOptions.getBiomeSizeEndLand(), BiomeAPI.END_LAND_BIOME_PICKER); this.mapVoid = new BiomeMap(seed, GeneratorOptions.getBiomeSizeEndVoid(), BiomeAPI.END_VOID_BIOME_PICKER); this.centerBiome = biomeRegistry.getOrThrow(Biomes.THE_END); @@ -71,7 +58,23 @@ public class BCLibEndBiomeSource extends BiomeSource { } private static List getBiomes(Registry biomeRegistry) { - return biomeRegistry.stream().filter(biome -> BiomeAPI.isEndBiome(biomeRegistry.getKey(biome))).toList(); + BiomeAPI.END_LAND_BIOME_PICKER.clearMutables(); + BiomeAPI.END_VOID_BIOME_PICKER.clearMutables(); + biomeRegistry.forEach(biome -> { + ResourceLocation key = biomeRegistry.getKey(biome); + BCLBiome bclBiome = BiomeAPI.getBiome(key); + bclBiome.updateActualBiomes(biomeRegistry); + if (!BiomeAPI.END_LAND_BIOME_PICKER.containsImmutable(key)) { + BiomeAPI.END_LAND_BIOME_PICKER.addBiomeMutable(bclBiome); + } + }); + BiomeAPI.END_LAND_BIOME_PICKER.rebuild(); + BiomeAPI.END_VOID_BIOME_PICKER.rebuild(); + + return biomeRegistry.stream().filter(biome -> { + ResourceLocation key = biomeRegistry.getKey(biome); + return BiomeAPI.END_LAND_BIOME_PICKER.contains(key) || BiomeAPI.END_VOID_BIOME_PICKER.contains(key); + }).toList(); } @Override diff --git a/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java b/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java index e9472f4f..c60994aa 100644 --- a/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java +++ b/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java @@ -35,6 +35,15 @@ public class BCLibNetherBiomeSource extends BiomeSource { public BCLibNetherBiomeSource(Registry biomeRegistry, long seed) { super(getBiomes(biomeRegistry)); + this.biomeMap = new BiomeMap(seed, GeneratorOptions.getBiomeSizeEndLand(), BiomeAPI.NETHER_BIOME_PICKER); + this.biomeRegistry = biomeRegistry; + this.seed = seed; + + WorldgenRandom chunkRandom = new WorldgenRandom(seed); + chunkRandom.consumeCount(17292); + } + + private static List getBiomes(Registry biomeRegistry) { BiomeAPI.NETHER_BIOME_PICKER.clearMutables(); biomeRegistry.forEach(biome -> { ResourceLocation key = biomeRegistry.getKey(biome); @@ -46,16 +55,7 @@ public class BCLibNetherBiomeSource extends BiomeSource { }); BiomeAPI.NETHER_BIOME_PICKER.rebuild(); - this.biomeMap = new BiomeMap(seed, GeneratorOptions.getBiomeSizeEndLand(), BiomeAPI.NETHER_BIOME_PICKER); - this.biomeRegistry = biomeRegistry; - this.seed = seed; - - WorldgenRandom chunkRandom = new WorldgenRandom(seed); - chunkRandom.consumeCount(17292); - } - - private static List getBiomes(Registry biomeRegistry) { - return biomeRegistry.stream().filter(biome -> BiomeAPI.isEndBiome(biomeRegistry.getKey(biome))).toList(); + return biomeRegistry.stream().filter(biome -> BiomeAPI.NETHER_BIOME_PICKER.contains(biomeRegistry.getKey(biome))).toList(); } @Override