Changed handling of vanilla/fabric end biomes
This commit is contained in:
parent
7c810cd3a7
commit
f72081620a
2 changed files with 20 additions and 4 deletions
|
@ -232,7 +232,11 @@ public class BiomeAPI {
|
||||||
ResourceKey<Biome> key = getBiomeKey(biome.getBiome());
|
ResourceKey<Biome> key = getBiomeKey(biome.getBiome());
|
||||||
if (biome.allowFabricRegistration()) {
|
if (biome.allowFabricRegistration()) {
|
||||||
TheEndBiomes.addHighlandsBiome(key, weight);
|
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;
|
return biome;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,14 +32,26 @@ public class TheEndBiomeDataMixin implements TheEndBiomeDataAccessor {
|
||||||
private Map<Holder<Biome>, WeightedPicker<Holder<Biome>>> endBarrensMap;
|
private Map<Holder<Biome>, WeightedPicker<Holder<Biome>>> endBarrensMap;
|
||||||
|
|
||||||
public boolean bcl_canGenerateAsEndBiome(ResourceKey<Biome> key) {
|
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) {
|
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) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue