mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-28 06:50:02 +00:00
Kept mod biomes findable
- Themed regions, those at least five times rarer than the dimension's median region, no longer receive adopted biomes while a common region accepts the biome's role - Themed regions still take a mod biome when no common region has a pool for its role or every common template is full - Category affinity now chooses among common regions, so a rare biome is no longer locked inside a region that can be absent for thousands of blocks
This commit is contained in:
2 files changed
+62
-22
No files matched your search
@@ -45,7 +45,6 @@ final class ModBiomeAdopter {
|
||||
private static final double REGION_CLIMATE_WEIGHT = 0.25D;
|
||||
private static final double REGION_CATEGORY_WEIGHT = 0.25D;
|
||||
private static final double REUSE_WEIGHT = 0.05D;
|
||||
private static final double THEMED_REGION_PENALTY = 0.6D;
|
||||
private static final double BARE_SURFACE_PENALTY = 3D;
|
||||
private static final int THEMED_RARITY_FACTOR = 5;
|
||||
|
||||
@@ -102,15 +101,20 @@ final class ModBiomeAdopter {
|
||||
}
|
||||
|
||||
private Placement place(BiomeRole role, IngestClimate climate, Set<String> categories, boolean ownsVegetation) throws IOException {
|
||||
Placement common = bestPlacement(role, climate, categories, ownsVegetation, false);
|
||||
return common != null ? common : bestPlacement(role, climate, categories, ownsVegetation, true);
|
||||
}
|
||||
|
||||
private Placement bestPlacement(BiomeRole role, IngestClimate climate, Set<String> categories, boolean ownsVegetation,
|
||||
boolean themed) throws IOException {
|
||||
Placement best = null;
|
||||
double bestScore = Double.POSITIVE_INFINITY;
|
||||
for (IngestPackModel.RegionProfile region : model.regions()) {
|
||||
if (excludedRegions.contains(region.key())) {
|
||||
if (excludedRegions.contains(region.key()) || themedRegions.contains(region.key()) != themed) {
|
||||
continue;
|
||||
}
|
||||
IngestClimate regionClimate = regionClimate(region, role, categories);
|
||||
double regionPenalty = (themedRegions.contains(region.key()) ? THEMED_REGION_PENALTY : 0D)
|
||||
+ (regionClimate == null ? 0D : REGION_CLIMATE_WEIGHT * climate.distance(regionClimate))
|
||||
double regionPenalty = (regionClimate == null ? 0D : REGION_CLIMATE_WEIGHT * climate.distance(regionClimate))
|
||||
+ REGION_CATEGORY_WEIGHT * (1D - regionAffinity(region, role, categories));
|
||||
for (String template : region.pool(role)) {
|
||||
int uses = templateUses.getOrDefault(template, 0);
|
||||
|
||||
Reference in new issue
Block a user