Changed handling of vanilla/fabric end biomes

This commit is contained in:
Frank 2022-06-14 14:29:50 +02:00
parent 7c810cd3a7
commit f72081620a
2 changed files with 20 additions and 4 deletions

View file

@ -232,7 +232,11 @@ public class BiomeAPI {
ResourceKey<Biome> key = getBiomeKey(biome.getBiome());
if (biome.allowFabricRegistration()) {
TheEndBiomes.addHighlandsBiome(key, weight);
//TheEndBiomes.addMidlandsBiome(key, weight);
TheEndBiomes.addMidlandsBiome(key, key, weight);
if (biome.isEdgeBiome()) {
ResourceKey<Biome> parentKey = getBiomeKey(biome.getParentBiome().getBiome());
TheEndBiomes.addMidlandsBiome(parentKey, key, weight);
}
}
return biome;
}

View file

@ -32,14 +32,26 @@ public class TheEndBiomeDataMixin implements TheEndBiomeDataAccessor {
private Map<Holder<Biome>, WeightedPicker<Holder<Biome>>> endBarrensMap;
public boolean bcl_canGenerateAsEndBiome(ResourceKey<Biome> key) {
return endBiomesMap != null && endBiomesMap.keySet().stream().map(h->h.unwrapKey().orElse(null)).anyMatch(k->k!=null && k.equals(key));
return endBiomesMap != null && endBiomesMap
.keySet()
.stream()
.map(h->h.unwrapKey().orElse(null))
.anyMatch(k->k!=null && k.equals(key));
}
public boolean bcl_canGenerateAsEndMidlandBiome(ResourceKey<Biome> key) {
return endMidlandsMap != null && endMidlandsMap.keySet().stream().map(h->h.unwrapKey().orElse(null)).anyMatch(k->k!=null && k.equals(key));
return endMidlandsMap != null && endMidlandsMap
.keySet()
.stream()
.map(h->h.unwrapKey().orElse(null))
.anyMatch(k->k!=null && k.equals(key));
}
public boolean bcl_canGenerateAsEndBarrensBiome(ResourceKey<Biome> key) {
return endBarrensMap != null && endBarrensMap.keySet().stream().map(h->h.unwrapKey().orElse(null)).anyMatch(k->k!=null && k.equals(key));
return endBarrensMap != null && endBarrensMap
.keySet()
.stream()
.map(h->h.unwrapKey().orElse(null))
.anyMatch(k->k!=null && k.equals(key));
}
}