--- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java
+++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java
@@ -3,28 +3,49 @@
 import net.minecraft.world.WorldType;
 import net.minecraft.world.biome.BiomeGenBase;
 import net.minecraft.world.gen.ChunkProviderSettings;
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.util.WeightedRandom;
+import net.minecraftforge.common.BiomeManager;
+import net.minecraftforge.common.BiomeManager.BiomeEntry;
+import static net.minecraftforge.common.BiomeManager.BiomeType.*;
 
 public class GenLayerBiome extends GenLayer
 {
-    private BiomeGenBase[] field_151623_c;
-    private BiomeGenBase[] field_151621_d;
-    private BiomeGenBase[] field_151622_e;
-    private BiomeGenBase[] field_151620_f;
+    private List<BiomeEntry>[] biomes = new ArrayList[BiomeManager.BiomeType.values().length];
+
     private final ChunkProviderSettings field_175973_g;
     private static final String __OBFID = "CL_00000555";
 
     public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_)
     {
         super(p_i45560_1_);
-        this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76769_d, BiomeGenBase.field_76769_d, BiomeGenBase.field_150588_X, BiomeGenBase.field_150588_X, BiomeGenBase.field_76772_c};
-        this.field_151621_d = new BiomeGenBase[] {BiomeGenBase.field_76767_f, BiomeGenBase.field_150585_R, BiomeGenBase.field_76770_e, BiomeGenBase.field_76772_c, BiomeGenBase.field_150583_P, BiomeGenBase.field_76780_h};
-        this.field_151622_e = new BiomeGenBase[] {BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76768_g, BiomeGenBase.field_76772_c};
-        this.field_151620_f = new BiomeGenBase[] {BiomeGenBase.field_76774_n, BiomeGenBase.field_76774_n, BiomeGenBase.field_76774_n, BiomeGenBase.field_150584_S};
         this.field_75909_a = p_i45560_3_;
 
+        for (BiomeManager.BiomeType type : BiomeManager.BiomeType.values())
+        {
+            com.google.common.collect.ImmutableList<BiomeEntry> biomesToAdd = BiomeManager.getBiomes(type);
+            int idx = type.ordinal();
+
+            if (biomes[idx] == null) biomes[idx] = new ArrayList<BiomeEntry>();
+            if (biomesToAdd != null) biomes[idx].addAll(biomesToAdd);
+        }
+
+        int desertIdx = DESERT.ordinal();
+
+        biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76769_d, 30));
+        biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_150588_X, 20));
+        biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76772_c, 10));
+
         if (p_i45560_4_ == WorldType.field_77136_e)
         {
-            this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g};
+            biomes[desertIdx].clear();
+            biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76769_d, 10));
+            biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76767_f, 10));
+            biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76770_e, 10));
+            biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76780_h, 10));
+            biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76772_c, 10));
+            biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76768_g, 10));
             this.field_175973_g = null;
         }
         else if (p_i45560_4_ == WorldType.field_180271_f)
@@ -78,7 +99,7 @@
                     }
                     else
                     {
-                        aint1[j1 + i1 * p_75904_3_] = this.field_151623_c[this.func_75902_a(this.field_151623_c.length)].field_76756_M;
+                        aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry(DESERT).biome.field_76756_M;
                     }
                 }
                 else if (k1 == 2)
@@ -89,7 +110,7 @@
                     }
                     else
                     {
-                        aint1[j1 + i1 * p_75904_3_] = this.field_151621_d[this.func_75902_a(this.field_151621_d.length)].field_76756_M;
+                        aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry(WARM).biome.field_76756_M;
                     }
                 }
                 else if (k1 == 3)
@@ -100,12 +121,12 @@
                     }
                     else
                     {
-                        aint1[j1 + i1 * p_75904_3_] = this.field_151622_e[this.func_75902_a(this.field_151622_e.length)].field_76756_M;
+                        aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry(COOL).biome.field_76756_M;
                     }
                 }
                 else if (k1 == 4)
                 {
-                    aint1[j1 + i1 * p_75904_3_] = this.field_151620_f[this.func_75902_a(this.field_151620_f.length)].field_76756_M;
+                    aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry(ICY).biome.field_76756_M;
                 }
                 else
                 {
@@ -116,4 +137,12 @@
 
         return aint1;
     }
+
+    protected BiomeEntry getWeightedBiomeEntry(BiomeManager.BiomeType type)
+    {
+        List<BiomeEntry> biomeList = biomes[type.ordinal()];
+        int totalWeight = WeightedRandom.func_76272_a(biomeList);
+        int weight = BiomeManager.isTypeListModded(type)?func_75902_a(totalWeight):func_75902_a(totalWeight / 10) * 10;
+        return (BiomeEntry)WeightedRandom.func_180166_a(biomeList, weight);
+    }
 }
