package org.cyclops.integrateddynamics.world.biome;

import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeManager;
import org.cyclops.cyclopscore.config.ConfigurableProperty;
import org.cyclops.cyclopscore.config.ConfigurableTypeCategory;
import org.cyclops.cyclopscore.config.extendedconfig.BiomeConfig;
import org.cyclops.integrateddynamics.IntegratedDynamics;
import org.cyclops.integrateddynamics.Reference;

/**
 * Config for {@link BiomeMeneglin}.
 * @author rubensworks
 *
 */
public class BiomeMeneglinConfig extends BiomeConfig {
    
    /**
     * The unique instance.
     */
    public static BiomeMeneglinConfig _instance;

    /**
     * The weight of spawning in a cool biome type.
     */
    @ConfigurableProperty(category = ConfigurableTypeCategory.BIOME, comment = "The weight of spawning in a cool biome type.")
    public static int spawnWeightCool = 4;

    /**
     * The weight of spawning in a forest biome type.
     */
    @ConfigurableProperty(category = ConfigurableTypeCategory.BIOME, comment = "The weight of spawning in a forest biome type.")
    public static int spawnWeightForest = 6;

    /**
     * The weight of spawning in a magical biome type.
     */
    @ConfigurableProperty(category = ConfigurableTypeCategory.BIOME, comment = "The weight of spawning in a magical biome type.")
    public static int spawnWeightMagical = 10;

    /**
     * The weight of spawning in a lush biome type.
     */
    @ConfigurableProperty(category = ConfigurableTypeCategory.BIOME, comment = "The weight of spawning in a lush biome type.")
    public static int spawnWeightLush = 8;

    /**
     * Make a new instance.
     */
    public BiomeMeneglinConfig() {
        super(
                IntegratedDynamics._instance,
                Reference.BIOME_MENEGLIN,
                "biomeMeneglin",
                null,
                BiomeMeneglin.class
        );
    }
    
    @Override
    public void registerBiomeDictionary() {
        if (spawnWeightCool > 0) {
            BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(getBiome(), spawnWeightCool));
        }
        if (spawnWeightForest > 0) {
            BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(getBiome(), spawnWeightForest));
        }
        if (spawnWeightMagical > 0) {
            BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(getBiome(), spawnWeightMagical));
        }
        if (spawnWeightLush > 0) {
            BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(getBiome(), spawnWeightLush));
        }
        BiomeManager.addSpawnBiome(getBiome());
        BiomeManager.addStrongholdBiome(getBiome());
        BiomeManager.addVillageBiome(getBiome(), true);
        BiomeDictionary.registerBiomeType(getBiome(),
                BiomeDictionary.Type.COLD,
                BiomeDictionary.Type.FOREST,
                BiomeDictionary.Type.MAGICAL,
                BiomeDictionary.Type.LUSH
        );
    }
    
}

@@ -703,37 +703,16 @@
 spawning
- in a cool biome type
 .%0A     *
@@ -819,29 +819,8 @@
 ning
- in a cool biome type
 .%22)%0A
@@ -856,749 +856,12 @@
 ight
-Cool = 4;%0A%0A    /**%0A     * The weight of spawning in a forest biome type.%0A     */%0A    @ConfigurableProperty(category = ConfigurableTypeCategory.BIOME, comment = %22The weight of spawning in a forest biome type.%22)%0A    public static int spawnWeightForest = 6;%0A%0A    /**%0A     * The weight of spawning in a magical biome type.%0A     */%0A    @ConfigurableProperty(category = ConfigurableTypeCategory.BIOME, comment = %22The weight of spawning in a magical biome type.%22)%0A    public static int spawnWeightMagical = 10;%0A%0A    /**%0A     * The weight of spawning in a lush biome type.%0A     */%0A    @ConfigurableProperty(category = ConfigurableTypeCategory.BIOME, comment = %22The weight of spawning in a lush biome type.%22)%0A    public static int spawnWeightLush = 8
+ = 3
 ;%0A%0A 
@@ -1235,20 +1235,16 @@
 wnWeight
-Cool
  %3E 0) %7B%0A
@@ -1361,523 +1361,8 @@
 ight
-Cool));%0A        %7D%0A        if (spawnWeightForest %3E 0) %7B%0A            BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(getBiome(), spawnWeightForest));%0A        %7D%0A        if (spawnWeightMagical %3E 0) %7B%0A            BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(getBiome(), spawnWeightMagical));%0A        %7D%0A        if (spawnWeightLush %3E 0) %7B%0A            BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(getBiome(), spawnWeightLush
 ));%0A
@@ -1666,103 +1666,15 @@
 ype.
-FOREST,%0A                BiomeDictionary.Type.MAGICAL,%0A                BiomeDictionary.Type.LUSH
+MAGICAL
 %0A   

Fix Meneglin biomes spawning too frequently, Closes #24