Fix for biome weights under 10
This solves the problem where custom mod biomes with weights under 10 not being generated in the world. Cleaned up the code and made the patch smaller
This commit is contained in:
parent
6283e9327e
commit
46dfaa6d0c
1 changed files with 2 additions and 4 deletions
|
@ -96,7 +96,7 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -101,4 +124,14 @@
|
@@ -101,4 +124,12 @@
|
||||||
|
|
||||||
return aint1;
|
return aint1;
|
||||||
}
|
}
|
||||||
|
@ -105,9 +105,7 @@
|
||||||
+ {
|
+ {
|
||||||
+ List<BiomeEntry> biomeList = biomes[type.ordinal()];
|
+ List<BiomeEntry> biomeList = biomes[type.ordinal()];
|
||||||
+ int totalWeight = WeightedRandom.func_76272_a(biomeList);
|
+ int totalWeight = WeightedRandom.func_76272_a(biomeList);
|
||||||
+ int rand = func_75902_a(totalWeight / 10) * 10;
|
+ int weight = BiomeManager.isTypeListModded(type)?func_75902_a(totalWeight):func_75902_a(totalWeight / 10) * 10;
|
||||||
+ int weight = rand + (BiomeManager.isTypeListModded(type) ? func_75902_a(Math.min(10, totalWeight - rand)) : 0);
|
|
||||||
+
|
|
||||||
+ return (BiomeEntry)WeightedRandom.getItem(biomeList, weight);
|
+ return (BiomeEntry)WeightedRandom.getItem(biomeList, weight);
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue