Fixed modded overworld biomes not spawning [1.16.x] (#6990)

This commit is contained in:
Xerousso authored and GitHub committed 2020-07-27 14:10:42 -07:00
1 parent 9d84b5df31
commit 27798c5804
4 files changed
+128 -2

No files matched your search

@@ -29,6 +29,7 @@ import net.minecraft.world.biome.Biomes;
import net.minecraft.util.WeightedRandom;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.provider.BiomeProvider;
import net.minecraft.world.gen.INoiseRandom;
import javax.annotation.Nullable;
@@ -154,6 +155,16 @@ public class BiomeManager
}
}
public static BiomeEntry getWeightedBiomeEntry(BiomeType type, INoiseRandom context)
{
List<BiomeEntry> biomeList = biomes[type.ordinal()];
int totalWeight = WeightedRandom.getTotalWeight(biomeList);
int weight = isTypeListModded(type) ? context.random(totalWeight) : context.random(totalWeight / 10) * 10;
return WeightedRandom.getRandomItem(biomeList, weight);
}
private static class TrackedList<E> extends ArrayList<E>
{
private static final long serialVersionUID = 1L;