More fixes

This commit is contained in:
paulevsGitch 2021-08-13 22:08:18 +03:00
parent 0acb947795
commit c2015848b0
2 changed files with 27 additions and 24 deletions

View file

@ -42,19 +42,6 @@ public class BCLibEndBiomeSource extends BiomeSource {
public BCLibEndBiomeSource(Registry<Biome> biomeRegistry, long seed) { public BCLibEndBiomeSource(Registry<Biome> biomeRegistry, long seed) {
super(getBiomes(biomeRegistry)); 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.mapLand = new BiomeMap(seed, GeneratorOptions.getBiomeSizeEndLand(), BiomeAPI.END_LAND_BIOME_PICKER);
this.mapVoid = new BiomeMap(seed, GeneratorOptions.getBiomeSizeEndVoid(), BiomeAPI.END_VOID_BIOME_PICKER); this.mapVoid = new BiomeMap(seed, GeneratorOptions.getBiomeSizeEndVoid(), BiomeAPI.END_VOID_BIOME_PICKER);
this.centerBiome = biomeRegistry.getOrThrow(Biomes.THE_END); this.centerBiome = biomeRegistry.getOrThrow(Biomes.THE_END);
@ -71,7 +58,23 @@ public class BCLibEndBiomeSource extends BiomeSource {
} }
private static List<Biome> getBiomes(Registry<Biome> biomeRegistry) { private static List<Biome> getBiomes(Registry<Biome> 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 @Override

View file

@ -35,6 +35,15 @@ public class BCLibNetherBiomeSource extends BiomeSource {
public BCLibNetherBiomeSource(Registry<Biome> biomeRegistry, long seed) { public BCLibNetherBiomeSource(Registry<Biome> biomeRegistry, long seed) {
super(getBiomes(biomeRegistry)); 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<Biome> getBiomes(Registry<Biome> biomeRegistry) {
BiomeAPI.NETHER_BIOME_PICKER.clearMutables(); BiomeAPI.NETHER_BIOME_PICKER.clearMutables();
biomeRegistry.forEach(biome -> { biomeRegistry.forEach(biome -> {
ResourceLocation key = biomeRegistry.getKey(biome); ResourceLocation key = biomeRegistry.getKey(biome);
@ -46,16 +55,7 @@ public class BCLibNetherBiomeSource extends BiomeSource {
}); });
BiomeAPI.NETHER_BIOME_PICKER.rebuild(); BiomeAPI.NETHER_BIOME_PICKER.rebuild();
this.biomeMap = new BiomeMap(seed, GeneratorOptions.getBiomeSizeEndLand(), BiomeAPI.NETHER_BIOME_PICKER); return biomeRegistry.stream().filter(biome -> BiomeAPI.NETHER_BIOME_PICKER.contains(biomeRegistry.getKey(biome))).toList();
this.biomeRegistry = biomeRegistry;
this.seed = seed;
WorldgenRandom chunkRandom = new WorldgenRandom(seed);
chunkRandom.consumeCount(17292);
}
private static List<Biome> getBiomes(Registry<Biome> biomeRegistry) {
return biomeRegistry.stream().filter(biome -> BiomeAPI.isEndBiome(biomeRegistry.getKey(biome))).toList();
} }
@Override @Override