mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Fixed modded overworld biomes not spawning [1.16.x] (#6990)
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user