[Fix] Handling of vanilla/fabric End Biomes

This commit is contained in:
Frank 2022-07-01 20:00:46 +02:00
parent aaba0cec25
commit c5c61a11fd
4 changed files with 22 additions and 18 deletions

View file

@ -125,7 +125,10 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
if (bclBiome != BiomeAPI.EMPTY_BIOME) { if (bclBiome != BiomeAPI.EMPTY_BIOME) {
if (bclBiome.getParentBiome() == null) { if (bclBiome.getParentBiome() == null) {
if (config.withVoidBiomes) { if (config.withVoidBiomes) {
if (BiomeAPI.wasRegisteredAsEndVoidBiome(biomeID) if (biomeID.equals(Biomes.THE_END.location())) {
//we discard those Biomes
} else if (BiomeAPI.wasRegisteredAsEndVoidBiome(biomeID)
|| biomeID.equals(Biomes.SMALL_END_ISLANDS.location())
|| TheEndBiomesHelper.isIntendedForEndBarrens(key) || TheEndBiomesHelper.isIntendedForEndBarrens(key)
|| includeVoid.contains(biomeID.toString()) || includeVoid.contains(biomeID.toString())
) { ) {
@ -137,16 +140,17 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
endLandBiomePicker.addBiome(bclBiome); endLandBiomePicker.addBiome(bclBiome);
} }
} else { } else {
if (BiomeAPI.wasRegisteredAsEndLandBiome(biomeID) if (biomeID.equals(Biomes.SMALL_END_ISLANDS.location())
|| biomeID.equals(Biomes.THE_END.location())
) {
//we discard those Biomes
} else if (BiomeAPI.wasRegisteredAsEndLandBiome(biomeID)
|| TheEndBiomesHelper.isIntendedForEndLand(key) || TheEndBiomesHelper.isIntendedForEndLand(key)
|| includeLand.contains(biomeID.toString()) || includeLand.contains(biomeID.toString())
) { ) {
endLandBiomePicker.addBiome(bclBiome); endLandBiomePicker.addBiome(bclBiome);
endVoidBiomePicker.addBiome(bclBiome); endVoidBiomePicker.addBiome(bclBiome);
} } else if (BiomeAPI.wasRegisteredAsEndVoidBiome(biomeID) || includeVoid.contains(biomeID.toString())) {
if (!biomeID.equals(Biomes.SMALL_END_ISLANDS.location()) && !biomeID.equals(Biomes.THE_END.location())
&& (BiomeAPI.wasRegisteredAsEndVoidBiome(biomeID) || includeVoid.contains(biomeID.toString()))
) {
endVoidBiomePicker.addBiome(bclBiome); endVoidBiomePicker.addBiome(bclBiome);
} }
@ -272,7 +276,6 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
mapLand.clearCache(); mapLand.clearCache();
mapVoid.clearCache(); mapVoid.clearCache();
} }
if (config.generatorVersion == BCLEndBiomeSourceConfig.EndBiomeGeneratorType.VANILLA || endLandFunction == null) { if (config.generatorVersion == BCLEndBiomeSourceConfig.EndBiomeGeneratorType.VANILLA || endLandFunction == null) {
if (dist <= (long) config.innerVoidRadiusSquared) { if (dist <= (long) config.innerVoidRadiusSquared) {
return this.centerBiome; return this.centerBiome;

View file

@ -75,7 +75,7 @@ public class TheEndBiomesHelper {
* and any biomes added to the End as midland biome by mods. * and any biomes added to the End as midland biome by mods.
*/ */
public static boolean isIntendedForEndMidlands(ResourceKey<Biome> biome) { public static boolean isIntendedForEndMidlands(ResourceKey<Biome> biome) {
return get().bcl_canGenerateAsEndMidlandBiome(biome); return get().bcl_canGenerateAsEndMidlandBiome(biome) && !get().bcl_canGenerateAsEndBiome(biome);
} }
/** /**
@ -83,7 +83,8 @@ public class TheEndBiomesHelper {
* and any biomes added to the End as barrens biome by mods. * and any biomes added to the End as barrens biome by mods.
*/ */
public static boolean isIntendedForEndBarrens(ResourceKey<Biome> biome) { public static boolean isIntendedForEndBarrens(ResourceKey<Biome> biome) {
return get().bcl_canGenerateAsEndBarrensBiome(biome); return get().bcl_canGenerateAsEndBarrensBiome(biome) && !get().bcl_canGenerateAsEndBiome(biome) && !get().bcl_canGenerateAsEndMidlandBiome(
biome);
} }
public static boolean isIntendedForEndLand(ResourceKey<Biome> biome) { public static boolean isIntendedForEndLand(ResourceKey<Biome> biome) {

View file

@ -31,7 +31,7 @@ public class BCLEndBiomeSourceConfig implements BiomeSourceConfig<BCLibEndBiomeS
public static final BCLEndBiomeSourceConfig MINECRAFT_18 = new BCLEndBiomeSourceConfig( public static final BCLEndBiomeSourceConfig MINECRAFT_18 = new BCLEndBiomeSourceConfig(
EndBiomeMapType.HEX, EndBiomeMapType.HEX,
EndBiomeGeneratorType.PAULEVS, EndBiomeGeneratorType.PAULEVS,
false, true,
MINECRAFT_17.innerVoidRadiusSquared MINECRAFT_17.innerVoidRadiusSquared
); );
public static final BCLEndBiomeSourceConfig DEFAULT = MINECRAFT_18; public static final BCLEndBiomeSourceConfig DEFAULT = MINECRAFT_18;

View file

@ -117,14 +117,14 @@ public class BiomeAPI {
public static final BCLBiome THE_END = registerCenterBiome(getFromRegistry(Biomes.THE_END)); public static final BCLBiome THE_END = registerCenterBiome(getFromRegistry(Biomes.THE_END));
public static final BCLBiome END_MIDLANDS = registerSubBiome(
THE_END, public static final BCLBiome END_HIGHLANDS = registerEndLandBiome(
getFromRegistry(Biomes.END_MIDLANDS).value(), getFromRegistry(Biomes.END_HIGHLANDS),
0.5F 0.5F
); );
public static final BCLBiome END_HIGHLANDS = registerSubBiome( public static final BCLBiome END_MIDLANDS = registerSubBiome(
THE_END, END_HIGHLANDS,
getFromRegistry(Biomes.END_HIGHLANDS).value(), getFromRegistry(Biomes.END_MIDLANDS).value(),
0.5F 0.5F
); );
@ -302,7 +302,7 @@ public class BiomeAPI {
public static BCLBiome registerEndVoidBiome(Holder<Biome> biome) { public static BCLBiome registerEndVoidBiome(Holder<Biome> biome) {
BCLBiome bclBiome = new BCLBiome(biome.value(), null); BCLBiome bclBiome = new BCLBiome(biome.value(), null);
registerBiome(bclBiome, BiomeType.END_VOID); registerBiome(bclBiome, BiomeType.OTHER_END_VOID);
return bclBiome; return bclBiome;
} }
@ -334,7 +334,7 @@ public class BiomeAPI {
VanillaBiomeSettings.createVanilla().setGenChance(genChance).build() VanillaBiomeSettings.createVanilla().setGenChance(genChance).build()
); );
registerBiome(bclBiome, BiomeType.END_VOID); registerBiome(bclBiome, BiomeType.OTHER_END_VOID);
return bclBiome; return bclBiome;
} }