--- ../src-base/minecraft/net/minecraft/world/WorldType.java
+++ ../src-work/minecraft/net/minecraft/world/WorldType.java
@@ -1,5 +1,14 @@
 package net.minecraft.world;
 
+import java.util.Arrays;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiCreateFlatWorld;
+import net.minecraft.client.gui.GuiCreateWorld;
+import net.minecraft.client.gui.GuiCustomizeWorldScreen;
+import net.minecraft.world.gen.layer.GenLayer;
+import net.minecraft.world.gen.layer.GenLayerBiome;
+import net.minecraft.world.gen.layer.GenLayerBiomeEdge;
+import net.minecraft.world.gen.layer.GenLayerZoom;
 import net.minecraftforge.fml.relauncher.Side;
 import net.minecraftforge.fml.relauncher.SideOnly;
 
@@ -28,6 +37,7 @@
 
     private WorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_)
     {
+        if (p_i1960_2_.length() > 16 && field_180272_g != null) throw new IllegalArgumentException("World type names must not be longer then 16: " + p_i1960_2_);
         this.field_77133_f = p_i1960_2_;
         this.field_77134_g = p_i1960_3_;
         this.field_77140_h = true;
@@ -159,8 +169,99 @@
         return this == field_77138_c ? random.nextInt(4) != 1 : false;
     }
 
+    /*=================================================== FORGE START ======================================*/
+    private static int getNextID()
+    {
+        for (int x = 0; x < field_77139_a.length; x++)
+        {
+            if (field_77139_a[x] == null)
+            {
+                return x;
+            }
+        }
+
+        int oldLen = field_77139_a.length;
+        field_77139_a = Arrays.copyOf(field_77139_a, oldLen + 16);
+        return oldLen;
+    }
+
     /**
+     * Creates a new world type, the ID is hidden and should not be referenced by modders.
+     * It will automatically expand the underlying workdType array if there are no IDs left.
+     * @param name
+     */
+    public WorldType(String name)
+    {
+        this(getNextID(), name);
+    }
+
+    /**
      * Called when 'Create New World' button is pressed before starting game
      */
     public void onGUICreateWorldPress() { }
+
+    /**
+     * Gets the spawn fuzz for players who join the world.
+     * Useful for void world types.
+     * @return Fuzz for entity initial spawn in blocks.
+     */
+    public int getSpawnFuzz()
+    {
+        return Math.max(5, net.minecraft.server.MinecraftServer.func_71276_C().func_82357_ak() - 6);
+    }
+
+    /**
+     * Called when the 'Customize' button is pressed on world creation GUI
+     * @param mc The Minecraft instance
+     * @param guiCreateWorld the createworld GUI
+     */
+    @SideOnly(Side.CLIENT)
+    public void onCustomizeButton(Minecraft mc, GuiCreateWorld guiCreateWorld)
+    {
+        if (this == WorldType.field_77138_c)
+        {
+            mc.func_147108_a(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a));
+        }
+        else if (this == WorldType.field_180271_f)
+        {
+            mc.func_147108_a(new GuiCustomizeWorldScreen(guiCreateWorld, guiCreateWorld.field_146334_a));
+        }
+    }
+
+    /**
+     * Should world creation GUI show 'Customize' button for this world type?
+     * @return if this world type has customization parameters
+     */
+    public boolean isCustomizable()
+    {
+        return this == field_77138_c || this == WorldType.field_180271_f;
+    }
+
+
+    /**
+     * Get the height to render the clouds for this world type
+     * @return The height to render clouds at
+     */
+    public float getCloudHeight()
+    {
+        return 128.0F;
+    }
+
+    /**
+     * Creates the GenLayerBiome used for generating the world with the specified ChunkProviderSettings JSON String
+     * *IF AND ONLY IF* this WorldType == WorldType.CUSTOMIZED.
+     *
+     *
+     * @param worldSeed The world seed
+     * @param parentLayer The parent layer to feed into any layer you return
+     * @param chunkProviderSettingsJson The JSON string to use when initializing ChunkProviderSettings.Factory
+     * @return A GenLayer that will return ints representing the Biomes to be generated, see GenLayerBiome
+     */
+    public GenLayer getBiomeLayer(long worldSeed, GenLayer parentLayer, String chunkProviderSettingsJson)
+    {
+        GenLayer ret = new GenLayerBiome(200L, parentLayer, this, chunkProviderSettingsJson);
+        ret = GenLayerZoom.func_75915_a(1000L, ret, 2);
+        ret = new GenLayerBiomeEdge(1000L, ret);
+        return ret;
+    }
 }
