Fixed Generation Bugs

This commit is contained in:
Frank 2022-05-17 22:11:16 +02:00
parent 5ff00cede0
commit b84a5a1b5d
6 changed files with 11 additions and 15 deletions

View file

@ -581,7 +581,7 @@ public class BiomeAPI {
} }
/** /**
* Will apply biome modifications to world, internal usage only. * Will apply biome modiffications to world, internal usage only.
* @param level * @param level
*/ */
public static void applyModifications(ServerLevel level) { public static void applyModifications(ServerLevel level) {

View file

@ -187,7 +187,7 @@ public class TagType<T> {
public void apply(Map<ResourceLocation, Tag.Builder> tagsMap){ public void apply(Map<ResourceLocation, Tag.Builder> tagsMap){
if (Registry.BIOME_REGISTRY.equals(registryKey)) BiomeAPI._runTagAdders(); if (Registry.BIOME_REGISTRY.equals(registryKey)) BiomeAPI._runTagAdders();
this.isFrozen = true; //this.isFrozen = true;
this.forEach((id, ids) -> TagAPI.apply(tagsMap.computeIfAbsent(id, key -> Tag.Builder.tag()), ids)); this.forEach((id, ids) -> TagAPI.apply(tagsMap.computeIfAbsent(id, key -> Tag.Builder.tag()), ids));
} }
} }

View file

@ -42,7 +42,7 @@ public class FogRendererMixin {
fogBlue *= 4; fogBlue *= 4;
} }
} }
BackgroundInfo.fogColorRed = fogRed; BackgroundInfo.fogColorRed = fogRed;
BackgroundInfo.fogColorGreen = fogGreen; BackgroundInfo.fogColorGreen = fogGreen;
BackgroundInfo.fogColorBlue = fogBlue; BackgroundInfo.fogColorBlue = fogBlue;

View file

@ -87,18 +87,21 @@ public class BCLibEndBiomeSource extends BCLBiomeSource {
BCLBiome bclBiome = BiomeAPI.getBiome(key); BCLBiome bclBiome = BiomeAPI.getBiome(key);
if (bclBiome != BiomeAPI.EMPTY_BIOME) { if (bclBiome != BiomeAPI.EMPTY_BIOME) {
if (bclBiome.getParentBiome() == null) { if (bclBiome.getParentBiome() == null) {
if (includeVoid.contains(key.toString())) { if (BiomeAPI.wasRegisteredAsEndVoidBiome(key) || includeVoid.contains(key.toString())) {
endVoidBiomePicker.addBiome(bclBiome); endVoidBiomePicker.addBiome(bclBiome);
} else { } else {
endLandBiomePicker.addBiome(bclBiome); endLandBiomePicker.addBiome(bclBiome);
} }
} }
} }
} }
}); });
endLandBiomePicker.rebuild();
endVoidBiomePicker.rebuild();
this.centerBiome = biomeRegistry.getOrCreateHolder(Biomes.THE_END); this.centerBiome = biomeRegistry.getOrCreateHolder(Biomes.THE_END);
this.barrens = biomeRegistry.getOrCreateHolder(Biomes.END_BARRENS); this.barrens = biomeRegistry.getOrCreateHolder(Biomes.END_BARRENS);
@ -127,9 +130,7 @@ public class BCLibEndBiomeSource extends BCLBiomeSource {
final boolean isEndBiome = biome.is(BiomeTags.IS_END) || final boolean isEndBiome = biome.is(BiomeTags.IS_END) ||
BiomeAPI.wasRegisteredAsEndBiome(key); BiomeAPI.wasRegisteredAsEndBiome(key);
if (GeneratorOptions.addEndBiomesByTag() && isEndBiome) {
return true;
}
BCLBiome bclBiome = BiomeAPI.getBiome(key); BCLBiome bclBiome = BiomeAPI.getBiome(key);
if (bclBiome != BiomeAPI.EMPTY_BIOME) { if (bclBiome != BiomeAPI.EMPTY_BIOME) {

View file

@ -70,6 +70,8 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource {
} }
} }
}); });
biomePicker.rebuild();
} }
public BCLibNetherBiomeSource(Registry<Biome> biomeRegistry, long seed) { public BCLibNetherBiomeSource(Registry<Biome> biomeRegistry, long seed) {
@ -132,7 +134,6 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource {
public void setSeed(long seed) { public void setSeed(long seed) {
if (seed==currentSeed) return; if (seed==currentSeed) return;
super.setSeed(seed); super.setSeed(seed);
biomePicker.rebuild();
initMap(seed); initMap(seed);
} }

View file

@ -14,7 +14,6 @@ public class GeneratorOptions {
private static Function<Point, Boolean> endLandFunction; private static Function<Point, Boolean> endLandFunction;
private static boolean customNetherBiomeSource = true; private static boolean customNetherBiomeSource = true;
private static boolean customEndBiomeSource = true; private static boolean customEndBiomeSource = true;
private static boolean addEndBiomesByTag = true;
private static boolean useOldBiomeGenerator = false; private static boolean useOldBiomeGenerator = false;
private static boolean verticalBiomes = true; private static boolean verticalBiomes = true;
private static long farEndBiomesSqr = 1000000; private static long farEndBiomesSqr = 1000000;
@ -28,7 +27,6 @@ public class GeneratorOptions {
biomeSizeEndVoid = Configs.GENERATOR_CONFIG.getInt("end.biomeMap", "biomeSizeVoid", 256); biomeSizeEndVoid = Configs.GENERATOR_CONFIG.getInt("end.biomeMap", "biomeSizeVoid", 256);
customNetherBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options", "customNetherBiomeSource", true); customNetherBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options", "customNetherBiomeSource", true);
customEndBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options", "customEndBiomeSource", true); customEndBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options", "customEndBiomeSource", true);
addEndBiomesByTag = Configs.GENERATOR_CONFIG.getBoolean("options", "addEndBiomesByTag", true);
useOldBiomeGenerator = Configs.GENERATOR_CONFIG.useOldGenerator(); useOldBiomeGenerator = Configs.GENERATOR_CONFIG.useOldGenerator();
verticalBiomes = Configs.GENERATOR_CONFIG.getBoolean("options", "verticalBiomesInTallNether", true); verticalBiomes = Configs.GENERATOR_CONFIG.getBoolean("options", "verticalBiomesInTallNether", true);
fixEndBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options.biomeSource", "fixEndBiomeSource", true); fixEndBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options.biomeSource", "fixEndBiomeSource", true);
@ -87,10 +85,6 @@ public class GeneratorOptions {
return customEndBiomeSource; return customEndBiomeSource;
} }
public static boolean addEndBiomesByTag() {
return addEndBiomesByTag;
}
public static boolean useOldBiomeGenerator() { public static boolean useOldBiomeGenerator() {
return useOldBiomeGenerator; return useOldBiomeGenerator;
} }