More configuration options: enableSnow, enableRain, skyColor, hasBiomeEssence

This commit is contained in:
Cheeserolls 2015-05-26 17:25:50 +01:00
parent e83edcf214
commit c01e34ca85
4 changed files with 18 additions and 24 deletions

View file

@ -30,6 +30,10 @@ public class BOPBiome extends BiomeGenBase implements IExtendedBiome
private GenerationManager generationManager = new GenerationManager(); private GenerationManager generationManager = new GenerationManager();
private Map<BiomeType, Integer> weightMap = new HashMap<BiomeType, Integer>(); private Map<BiomeType, Integer> weightMap = new HashMap<BiomeType, Integer>();
// defaults
public int skyColor = -1; // -1 indicates the default skyColor by temperature will be used
public boolean hasBiomeEssence = true;
public BOPBiome() public BOPBiome()
{ {
super(-1, false); super(-1, false);
@ -55,7 +59,12 @@ public class BOPBiome extends BiomeGenBase implements IExtendedBiome
this.maxHeight = conf.getFloat("variation", this.maxHeight); this.maxHeight = conf.getFloat("variation", this.maxHeight);
this.temperature = conf.getFloat("temperature", this.temperature); this.temperature = conf.getFloat("temperature", this.temperature);
this.rainfall = conf.getFloat("rainfall", this.rainfall); this.rainfall = conf.getFloat("rainfall", this.rainfall);
this.color = conf.getInt("color",this.color);
this.waterColorMultiplier = conf.getInt("waterColorMultiplier", this.waterColorMultiplier); this.waterColorMultiplier = conf.getInt("waterColorMultiplier", this.waterColorMultiplier);
this.enableRain = conf.getBool("enableRain", this.enableRain);
this.enableSnow = conf.getBool("enableSnow", this.enableSnow);
this.skyColor = conf.getInt("skyColor", this.skyColor);
this.hasBiomeEssence = conf.getBool("hasBiomeEssence", this.hasBiomeEssence);
// Allow weights to be overridden // Allow weights to be overridden
IConfigObj confWeights = conf.getObject("weights"); IConfigObj confWeights = conf.getObject("weights");
@ -201,6 +210,12 @@ public class BOPBiome extends BiomeGenBase implements IExtendedBiome
// whether or not a biome essence item corresponding to this biome should be able to drop from biome blocks // whether or not a biome essence item corresponding to this biome should be able to drop from biome blocks
public boolean hasBiomeEssence() public boolean hasBiomeEssence()
{ {
return true; return this.hasBiomeEssence;
}
@Override
public int getSkyColorByTemp(float temperature)
{
return (this.skyColor == -1) ? super.getSkyColorByTemp(temperature) : this.skyColor;
} }
} }

View file

@ -13,7 +13,6 @@ import net.minecraftforge.common.BiomeManager.BiomeType;
import biomesoplenty.api.biome.BOPBiome; import biomesoplenty.api.biome.BOPBiome;
import biomesoplenty.api.biome.generation.GeneratorStage; import biomesoplenty.api.biome.generation.GeneratorStage;
import biomesoplenty.api.block.BOPBlocks; import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.config.MiscConfigurationHandler;
import biomesoplenty.common.world.feature.GeneratorOreSingle; import biomesoplenty.common.world.feature.GeneratorOreSingle;
public class BiomeGenCrag extends BOPBiome public class BiomeGenCrag extends BOPBiome
@ -34,16 +33,9 @@ public class BiomeGenCrag extends BOPBiome
this.topBlock = BOPBlocks.crag_rock.getDefaultState(); this.topBlock = BOPBlocks.crag_rock.getDefaultState();
this.fillerBlock = BOPBlocks.crag_rock.getDefaultState(); this.fillerBlock = BOPBlocks.crag_rock.getDefaultState();
this.waterColorMultiplier = 944693; this.waterColorMultiplier = 944693;
this.skyColor = 4944498;
this.addGenerator("emeralds", GeneratorStage.SAND, new GeneratorOreSingle(Blocks.emerald_ore.getDefaultState(), 12, 4, 32)); this.addGenerator("emeralds", GeneratorStage.SAND, new GeneratorOreSingle(Blocks.emerald_ore.getDefaultState(), 12, 4, 32));
} }
@Override
public int getSkyColorByTemp(float temperature)
{
if (MiscConfigurationHandler.skyColors)
return 4944498;
return super.getSkyColorByTemp(temperature);
}
} }

View file

@ -19,7 +19,6 @@ import biomesoplenty.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPGrass; import biomesoplenty.common.block.BlockBOPGrass;
import biomesoplenty.common.block.BlockBOPLeaves; import biomesoplenty.common.block.BlockBOPLeaves;
import biomesoplenty.common.block.BlockBOPGrass.BOPGrassType; import biomesoplenty.common.block.BlockBOPGrass.BOPGrassType;
import biomesoplenty.common.config.MiscConfigurationHandler;
import biomesoplenty.common.enums.BOPFlowers; import biomesoplenty.common.enums.BOPFlowers;
import biomesoplenty.common.enums.BOPTrees; import biomesoplenty.common.enums.BOPTrees;
import biomesoplenty.common.world.feature.GeneratorFlora; import biomesoplenty.common.world.feature.GeneratorFlora;
@ -34,6 +33,7 @@ public class BiomeGenOriginValley extends BOPBiome
this.setHeight(biomeHeight); this.setHeight(biomeHeight);
this.setColor(10341485); this.setColor(10341485);
this.setTemperatureRainfall(0.7F, 0.8F); this.setTemperatureRainfall(0.7F, 0.8F);
this.skyColor = 8441086;
this.addWeight(BiomeType.WARM, 1); this.addWeight(BiomeType.WARM, 1);
@ -60,12 +60,4 @@ public class BiomeGenOriginValley extends BOPBiome
return 3866368; return 3866368;
} }
@Override
public int getSkyColorByTemp(float temperature)
{
if (MiscConfigurationHandler.skyColors)
return 8441086;
return super.getSkyColorByTemp(temperature);
}
} }

View file

@ -17,9 +17,6 @@ public class MiscConfigurationHandler
{ {
public static Configuration config; public static Configuration config;
//TODO: Remove this in favour of making it configurable per biome
public static boolean skyColors;
public static boolean useBoPWorldTypeDefault; public static boolean useBoPWorldTypeDefault;
public static boolean overrideTitlePanorama; public static boolean overrideTitlePanorama;
@ -31,8 +28,6 @@ public class MiscConfigurationHandler
{ {
config.load(); config.load();
skyColors = config.getBoolean("Enable Sky Colors", "Enhancements", true, "Use the built-in sky colours defined for various biomes.");
//TODO: Make this default to true once all biomes have been implemented //TODO: Make this default to true once all biomes have been implemented
useBoPWorldTypeDefault = config.getBoolean("Default to BoP World Type", "GUI Settings", false, "Use the Biomes O' Plenty World Type by default when selecting a world."); useBoPWorldTypeDefault = config.getBoolean("Default to BoP World Type", "GUI Settings", false, "Use the Biomes O' Plenty World Type by default when selecting a world.");
overrideTitlePanorama = config.getBoolean("Enable Biomes O\' Plenty Main Menu Panorama", "GUI Settings", true, "Override the main menu panorama and use ours instead (It\'s nicer!)"); overrideTitlePanorama = config.getBoolean("Enable Biomes O\' Plenty Main Menu Panorama", "GUI Settings", true, "Override the main menu panorama and use ours instead (It\'s nicer!)");