package org.cyclops.cyclopscore.config.configurable;

import net.minecraft.world.biome.BiomeGenBase;
import org.cyclops.cyclopscore.config.extendedconfig.BiomeConfig;
import org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig;
import org.cyclops.cyclopscore.helper.L10NHelpers;

/**
 * A simple configurable for Biomes, will auto-register itself after construction.
 * @author rubensworks
 *
 */
public class ConfigurableBiome extends BiomeGenBase implements IConfigurable {

    protected BiomeConfig eConfig = null;
    
    /**
     * Make a new Biome instance
     * @param eConfig Config for this enchantment.
     */
    protected ConfigurableBiome(BiomeConfig eConfig) {
        super(new BiomeProperties(L10NHelpers.localize(eConfig.getUnlocalizedName())));
        this.setConfig(eConfig);
        
    }
    
    @SuppressWarnings("rawtypes")
    private void setConfig(ExtendedConfig eConfig) {
        this.eConfig = (BiomeConfig)eConfig;
    }

    @Override
    public ExtendedConfig<?> getConfig() {
        return eConfig;
    }

}

@@ -698,79 +698,186 @@
 per(
-new BiomeProperties(L10NHelpers.localize(eConfig.getUnlocalizedName()))
+constructProperties(eConfig));%0A        this.setConfig(eConfig);%0A    %7D%0A%0A    protected ConfigurableBiome(BiomeProperties properties, BiomeConfig eConfig) %7B%0A        super(properties
 );%0A 
@@ -912,20 +912,176 @@
 g);%0A    
+%7D%0A%0A
     
+protected static Properties constructProperties(BiomeConfig eConfig) %7B%0A        return new Properties(L10NHelpers.localize(eConfig.getUnlocalizedName()));
 %0A    %7D%0A 
@@ -1311,10 +1311,1472 @@
 %0A    %7D%0A%0A
+    /**%0A     * An extension of %7B@link BiomeProperties%7D which has all its setters made public.%0A     */%0A    public static class Properties extends BiomeProperties %7B%0A%0A        public Properties(String nameIn) %7B%0A            super(nameIn);%0A        %7D%0A%0A        @Override%0A        public Properties setTemperature(float temperatureIn) %7B%0A            return (Properties) super.setTemperature(temperatureIn);%0A        %7D%0A%0A        @Override%0A        public Properties setRainfall(float rainfallIn) %7B%0A            return (Properties) super.setRainfall(rainfallIn);%0A        %7D%0A%0A        @Override%0A        public Properties setBaseHeight(float baseHeightIn) %7B%0A            return (Properties) super.setBaseHeight(baseHeightIn);%0A        %7D%0A%0A        @Override%0A        public Properties setHeightVariation(float heightVariationIn) %7B%0A            return (Properties) super.setHeightVariation(heightVariationIn);%0A        %7D%0A%0A        @Override%0A        public Properties setRainDisabled() %7B%0A            return (Properties) super.setRainDisabled();%0A        %7D%0A%0A        @Override%0A        public Properties setSnowEnabled() %7B%0A            return (Properties) super.setSnowEnabled();%0A        %7D%0A%0A        @Override%0A        public Properties setWaterColor(int waterColorIn) %7B%0A            return (Properties) super.setWaterColor(waterColorIn);%0A        %7D%0A%0A        @Override%0A        public Properties setBaseBiome(String nameIn) %7B%0A            return (Properties) super.setBaseBiome(nameIn);%0A        %7D%0A    %7D%0A%0A
 %7D%0A

Add publicized biome properties class