Initial implementation of the Alps biome - This is what happens when certain people say certain things :)

This commit is contained in:
Adubbz 2015-03-14 11:55:07 +11:00
parent b3eaca7d51
commit eb120ac5f2
3 changed files with 69 additions and 2 deletions

View File

@ -15,9 +15,16 @@ public class BOPBiome extends BiomeGenBase implements IExtendedBiome
{
private GenerationManager generationManager = new GenerationManager();
public BOPBiome(int id)
public BOPBiome()
{
super(id, false);
super(-1, false);
this.theBiomeDecorator.treesPerChunk = -999;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.grassPerChunk = -999;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.theBiomeDecorator.clayPerChunk = -999;
}
@Override

View File

@ -0,0 +1,28 @@
/*******************************************************************************
* Copyright 2015, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.biome.overworld;
import net.minecraft.init.Blocks;
import biomesoplenty.api.biome.BOPBiome;
public class BiomeGenAlps extends BOPBiome
{
private static final Height biomeHeight = new Height(8.0F, 0.025F);
public BiomeGenAlps()
{
this.setHeight(biomeHeight);
this.setColor(13421772);
this.setEnableSnow();
this.setTemperatureRainfall(0.0F, 0.5F);
this.topBlock = Blocks.snow.getDefaultState();
this.fillerBlock = Blocks.snow.getDefaultState();
}
}

View File

@ -8,14 +8,21 @@
package biomesoplenty.common.init;
import static biomesoplenty.api.biome.BOPBiomes.alps;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.BiomeManager.BiomeEntry;
import net.minecraftforge.common.BiomeManager.BiomeType;
import biomesoplenty.common.biome.ExtendedBiomeRegistry;
import biomesoplenty.common.biome.overworld.BiomeGenAlps;
import biomesoplenty.common.config.BiomeConfigurationHandler;
import biomesoplenty.common.world.WorldTypeBOP;
public class ModBiomes
{
public static WorldTypeBOP worldTypeBOP;
private static int nextBiomeId = 40;
public static void init()
{
@ -27,6 +34,12 @@ public class ModBiomes
private static void registerBiomes()
{
alps = registerBiome(new BiomeGenAlps().setBiomeName("Alps"), "alps");
BiomeManager.addBiome(BiomeType.DESERT, new BiomeEntry(alps, 100));
BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(alps, 100));
BiomeManager.addBiome(BiomeType.COOL, new BiomeEntry(alps, 100));
BiomeManager.addBiome(BiomeType.ICY, new BiomeEntry(alps, 100));
}
private static void registerExternalBiomes()
@ -75,6 +88,7 @@ public class ModBiomes
private static BiomeGenBase registerBiome(BiomeGenBase biome, String id)
{
biome.biomeID = getNextFreeBiomeId();
BiomeConfigurationHandler.getConfigFileMap().put(biome, id);
return biome;
@ -87,4 +101,22 @@ public class ModBiomes
BiomeConfigurationHandler.getConfigFileMap().put(biome, id);
}
public static int getNextFreeBiomeId()
{
for (int i = nextBiomeId; i < 256; i++)
{
if (BiomeGenBase.getBiomeGenArray()[i] != null)
{
if (i == 255) throw new IllegalArgumentException("There are no more biome ids avaliable!");
continue;
}
else
{
nextBiomeId = i + 1;
return i;
}
}
return -1;
}
}