Added Oceanic Abyss sub-biome

This commit is contained in:
Matt Caughey 2013-09-12 22:27:32 -04:00
parent 249a7f1d8b
commit 35d07daa7a
7 changed files with 67 additions and 2 deletions

View file

@ -71,6 +71,7 @@ public class Biomes
public static Optional<? extends BiomeGenBase> oasis = Optional.absent();
public static Optional<? extends BiomeGenBase> oceanAbyss = Optional.absent();
public static Optional<? extends BiomeGenBase> oceanCoral = Optional.absent();
public static Optional<? extends BiomeGenBase> oceanKelp = Optional.absent();

View file

@ -0,0 +1,41 @@
package biomesoplenty.biomes;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import biomesoplenty.api.Blocks;
public class BiomeGenOceanAbyss extends BiomeGenBase
{
private BiomeDecoratorBOP customBiomeDecorator;
public BiomeGenOceanAbyss(int par1)
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
spawnableCreatureList.clear();
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 12 + par2Random.nextInt(6);
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
if (var10 == Block.stone.blockID)
{
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 12, 2);
}
}
}
}

View file

@ -128,7 +128,8 @@ public class BOPBiomes {
Biomes.oasis = Optional.of((new BiomeGenOasis(BOPConfiguration.IDs.oasisID)).setColor(16421912).setBiomeName("Oasis").setTemperatureRainfall(1.9F, 2.0F).setMinMaxHeight(0.3F, 0.4F));
Biomes.oceanCoral = Optional.of((new BiomeGenOceanCoral(BOPConfiguration.IDs.oceanCoralID)).setColor(10486015).setBiomeName("Coral Reef").setMinMaxHeight(-0.4F, -0.1F).setTemperatureRainfall(0.5F, 0.9F));
Biomes.oceanAbyss = Optional.of((new BiomeGenOceanAbyss(BOPConfiguration.IDs.oceanAbyssID)).setColor(10486015).setBiomeName("Oceanic Abyss").setMinMaxHeight(-1.75F, 0.0F).setTemperatureRainfall(0.5F, 0.9F));
Biomes.oceanCoral = Optional.of((new BiomeGenOceanCoral(BOPConfiguration.IDs.oceanCoralID)).setColor(10486015).setBiomeName("Coral Reef").setMinMaxHeight(-0.2F, -0.1F).setTemperatureRainfall(0.5F, 0.9F));
Biomes.oceanKelp = Optional.of((new BiomeGenOceanKelp(BOPConfiguration.IDs.oceanKelpID)).setColor(10486015).setBiomeName("Kelp Forest").setMinMaxHeight(-0.4F, -0.1F).setTemperatureRainfall(0.5F, 0.9F));
Biomes.ominousWoods = Optional.of((new BiomeGenOminousWoods(BOPConfiguration.IDs.ominousWoodsID)).setColor(353825).setBiomeName("Ominous Woods").setDisableRain().func_76733_a(5159473).setTemperatureRainfall(0.8F, 0.9F));
@ -264,6 +265,7 @@ public class BOPBiomes {
BiomeDictionary.registerBiomeType(Biomes.oasis.get(), Type.DESERT, Type.JUNGLE);
BiomeDictionary.registerBiomeType(Biomes.oceanAbyss.get(), Type.WATER);
BiomeDictionary.registerBiomeType(Biomes.oceanCoral.get(), Type.WATER);
BiomeDictionary.registerBiomeType(Biomes.oceanKelp.get(), Type.WATER, Type.FOREST);

View file

@ -743,6 +743,7 @@ public class BOPConfiguration
public static int oasisID;
public static int oceanAbyssID;
public static int oceanCoralID;
public static int oceanKelpID;
@ -1008,6 +1009,7 @@ public class BOPConfiguration
canyonRavineID = config.get("Biome IDs", "Canyon Ravine (Sub-Biome) ID", 49).getInt();
meadowForestID = config.get("Biome IDs", "Meadow Forest (Sub-Biome) ID", 50).getInt();
oceanAbyssID = config.get("Biome IDs", "Oceanic Abyss (Ocean) ID", 57).getInt();
oceanCoralID = config.get("Biome IDs", "Coral Reef (Ocean) ID", 58).getInt();
oceanKelpID = config.get("Biome IDs", "Kelp Forest (Ocean) ID", 59).getInt();

View file

@ -28,6 +28,10 @@ public class BiomeLayerBiomes extends BiomeLayer
//OCEAN BIOMES
oceanBiomes.add(BiomeGenBase.ocean);
if (Biomes.oceanAbyss.isPresent())
{
oceanBiomes.add(Biomes.oceanAbyss.get());
}
if (Biomes.oceanCoral.isPresent())
{
oceanBiomes.add(Biomes.oceanCoral.get());
@ -96,6 +100,7 @@ public class BiomeLayerBiomes extends BiomeLayer
int[] var5 = this.parent.getInts(par1, par2, par3, par4);
int[] var6 = IntCache.getIntCache(par3 * par4);
boolean abyss = Biomes.oceanCoral.isPresent();
boolean coral = Biomes.oceanCoral.isPresent();
boolean kelp = Biomes.oceanKelp.isPresent();
@ -116,6 +121,14 @@ public class BiomeLayerBiomes extends BiomeLayer
var6[var8 + var7 * par3] = surfaceBiomes[this.nextInt(surfaceBiomes.length)].biomeID;
}
if (abyss)
{
if(var9 == Biomes.oceanAbyss.get().biomeID)
{
var6[var8 + var7 * par3] = oceanBiomes.get(this.nextInt(oceanBiomes.size())).biomeID;
}
}
if (coral)
{
if(var9 == Biomes.oceanCoral.get().biomeID)

View file

@ -17,6 +17,7 @@ public class BiomeLayerCreate extends BiomeLayer
int[] var5 = IntCache.getIntCache(par3 * par4);
boolean ocean = BOPConfiguration.BiomeGen.oceanGen;
boolean abyss = Biomes.oceanAbyss.isPresent();
boolean coral = Biomes.oceanCoral.isPresent();
boolean kelp = Biomes.oceanKelp.isPresent();
@ -27,7 +28,8 @@ public class BiomeLayerCreate extends BiomeLayer
this.initChunkSeed(par1 + var7, par2 + var6);
if(ocean)
{
if(coral) { var5[var7 + var6 * par3] = this.nextInt(20) == 0 ? 1 : Biomes.oceanCoral.get().biomeID; }
if(abyss) { var5[var7 + var6 * par3] = this.nextInt(50) == 0 ? 1 : Biomes.oceanAbyss.get().biomeID; }
else if(coral) { var5[var7 + var6 * par3] = this.nextInt(20) == 0 ? 1 : Biomes.oceanCoral.get().biomeID; }
else if(kelp) { var5[var7 + var6 * par3] = this.nextInt(20) == 0 ? 1 : Biomes.oceanKelp.get().biomeID; }
else { var5[var7 + var6 * par3] = this.nextInt(10) == 0 ? 1 : 0;}
}

View file

@ -36,6 +36,10 @@ public class BiomeLayerShore extends BiomeLayer
//OCEAN BIOMES
oceanBiomes.add(BiomeGenBase.ocean);
if (Biomes.oceanAbyss.isPresent())
{
oceanBiomes.add(Biomes.oceanAbyss.get());
}
if (Biomes.oceanCoral.isPresent())
{
oceanBiomes.add(Biomes.oceanCoral.get());