Started adding decoration to the Undergarden.

This commit is contained in:
Matt Caughey 2013-05-18 11:28:50 -04:00
parent 6266846a47
commit 4c41f69729
4 changed files with 296 additions and 5 deletions

View file

@ -46,6 +46,7 @@ import biomesoplenty.worldgen.WorldGenMelon;
import biomesoplenty.worldgen.WorldGenMesa; import biomesoplenty.worldgen.WorldGenMesa;
import biomesoplenty.worldgen.WorldGenMud; import biomesoplenty.worldgen.WorldGenMud;
import biomesoplenty.worldgen.WorldGenMycelium; import biomesoplenty.worldgen.WorldGenMycelium;
import biomesoplenty.worldgen.WorldGenNetherVines;
import biomesoplenty.worldgen.WorldGenOasis; import biomesoplenty.worldgen.WorldGenOasis;
import biomesoplenty.worldgen.WorldGenOutback; import biomesoplenty.worldgen.WorldGenOutback;
import biomesoplenty.worldgen.WorldGenPit; import biomesoplenty.worldgen.WorldGenPit;
@ -186,6 +187,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected WorldGenerator holyTallGrassGen; protected WorldGenerator holyTallGrassGen;
protected WorldGenerator desertSproutsGen; protected WorldGenerator desertSproutsGen;
protected WorldGenerator promisedWillowGen; protected WorldGenerator promisedWillowGen;
protected WorldGenerator netherVineGen;
protected WorldGenerator quicksandGen; protected WorldGenerator quicksandGen;
protected WorldGenerator quicksand2Gen; protected WorldGenerator quicksand2Gen;
protected WorldGenerator poisonIvyGen; protected WorldGenerator poisonIvyGen;
@ -263,6 +265,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected int holyTallGrassPerChunk; protected int holyTallGrassPerChunk;
protected int desertSproutsPerChunk; protected int desertSproutsPerChunk;
protected int promisedWillowPerChunk; protected int promisedWillowPerChunk;
protected int netherVinesPerChunk;
protected int quicksandPerChunk; protected int quicksandPerChunk;
protected int quicksand2PerChunk; protected int quicksand2PerChunk;
protected int poisonIvyPerChunk; protected int poisonIvyPerChunk;
@ -405,6 +408,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.poisonIvyGen = new WorldGenBush(Blocks.foliage.get().blockID, 7); this.poisonIvyGen = new WorldGenBush(Blocks.foliage.get().blockID, 7);
this.sunflowerGen = new WorldGenSunflower(Blocks.flowers.get().blockID, 13); this.sunflowerGen = new WorldGenSunflower(Blocks.flowers.get().blockID, 13);
this.promisedWillowGen = new WorldGenPromisedWillow(); this.promisedWillowGen = new WorldGenPromisedWillow();
this.netherVineGen = new WorldGenNetherVines();
this.quicksandGen = new WorldGenQuicksand(); this.quicksandGen = new WorldGenQuicksand();
this.quicksand2Gen = new WorldGenQuicksand2(); this.quicksand2Gen = new WorldGenQuicksand2();
this.cattailGen = new WorldGenCattail(); this.cattailGen = new WorldGenCattail();
@ -490,6 +494,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.canyonGrassPerChunk = 0; this.canyonGrassPerChunk = 0;
this.steppePerChunk = 0; this.steppePerChunk = 0;
this.promisedWillowPerChunk = 0; this.promisedWillowPerChunk = 0;
this.netherVinesPerChunk = 0;
this.algaePerChunk = 0; this.algaePerChunk = 0;
this.pondsPerChunk = 0; this.pondsPerChunk = 0;
this.waterLakesPerChunk = 0; this.waterLakesPerChunk = 0;
@ -820,6 +825,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator
var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
this.promisedWillowGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5); this.promisedWillowGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
} }
for (var2 = 0; var2 < this.netherVinesPerChunk; ++var2)
{
var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
var4 = this.randomGenerator.nextInt(128);
var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
this.netherVineGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < this.whiteFlowersPerChunk; ++var2) for (var2 = 0; var2 < this.whiteFlowersPerChunk; ++var2)
{ {

View file

@ -1,9 +1,13 @@
package biomesoplenty.biomes; package biomesoplenty.biomes;
import java.util.Random;
import biomesoplenty.configuration.BOPConfiguration; import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.worldgen.WorldGenNetherMushroom;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry; import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntityMagmaCube; import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.monster.EntityPigZombie;
@ -17,6 +21,9 @@ public class BiomeGenNetherGarden extends BiomeGenBase
super(par1); super(par1);
this.theBiomeDecorator = new BiomeDecoratorBOP(this); this.theBiomeDecorator = new BiomeDecoratorBOP(this);
this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
this.customBiomeDecorator.treesPerChunk = 3;
this.customBiomeDecorator.netherVinesPerChunk = 40;
this.customBiomeDecorator.mushroomsPerChunk = 20;
this.spawnableMonsterList.clear(); this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear(); this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear(); this.spawnableWaterCreatureList.clear();
@ -25,4 +32,12 @@ public class BiomeGenNetherGarden extends BiomeGenBase
this.spawnableMonsterList.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); this.spawnableMonsterList.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4));
this.spawnableMonsterList.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); this.spawnableMonsterList.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
} }
/**
* Gets a WorldGen appropriate for this biome.
*/
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return new WorldGenNetherMushroom();
}
} }

View file

@ -9,25 +9,25 @@ import net.minecraft.block.Block;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenBOPBigMushroom extends WorldGenerator public class WorldGenNetherMushroom extends WorldGenerator
{ {
/** The mushroom type. 0 for brown, 1 for red. */ /** The mushroom type. 0 for brown, 1 for red. */
private int mushroomType = 1; private int mushroomType = 1;
public WorldGenBOPBigMushroom(int par1) public WorldGenNetherMushroom(int par1)
{ {
super(true); super(true);
this.mushroomType = par1; this.mushroomType = par1;
} }
public WorldGenBOPBigMushroom() public WorldGenNetherMushroom()
{ {
super(false); super(false);
} }
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{ {
int l = 1; int l = par2Random.nextInt(2);
if (this.mushroomType >= 0) if (this.mushroomType >= 0)
{ {
@ -84,7 +84,7 @@ public class WorldGenBOPBigMushroom extends WorldGenerator
{ {
j1 = par1World.getBlockId(par3, par4 - 1, par5); j1 = par1World.getBlockId(par3, par4 - 1, par5);
if (j1 != Block.dirt.blockID && j1 != Block.grass.blockID && j1 != Block.mycelium.blockID && j1 != Blocks.holyGrass.get().blockID) if (j1 != Block.netherrack.blockID)
{ {
return false; return false;
} }

View file

@ -0,0 +1,263 @@
package biomesoplenty.worldgen;
import java.util.Random;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenNetherVines extends WorldGenerator
{
public boolean generate(World var1, Random var2, int var3, int var4, int var5)
{
while (var1.isAirBlock(var3, var4, var5) && var4 > 2)
{
--var4;
}
int var6 = var1.getBlockId(var3, var4, var5);
if (var6 != Block.netherrack.blockID)
{
return false;
}
else
{
for (int var7 = -2; var7 <= 2; ++var7)
{
for (int var8 = -2; var8 <= 2; ++var8)
{
if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8))
{
return false;
}
}
}
if (var1.isAirBlock(var3 - 1, var4, var5))
{
var1.setBlock(var3 - 1, var4, var5, Block.vine.blockID, 8, 2);
}
if (var1.isAirBlock(var3 - 1, var4 - 1, var5))
{
var1.setBlock(var3 - 1, var4 - 1, var5, Block.vine.blockID, 8, 2);
}
if (var1.isAirBlock(var3 - 1, var4 - 2, var5))
{
var1.setBlock(var3 - 1, var4 - 2, var5, Block.vine.blockID, 8, 2);
}
if (var1.isAirBlock(var3 - 1, var4 - 3, var5))
{
var1.setBlock(var3 - 1, var4 - 3, var5, Block.vine.blockID, 8, 2);
}
if (var1.isAirBlock(var3 - 1, var4 - 4, var5))
{
var1.setBlock(var3 - 1, var4 - 4, var5, Block.vine.blockID, 8, 2);
}
if (var1.isAirBlock(var3 - 1, var4 - 5, var5))
{
var1.setBlock(var3 - 1, var4 - 5, var5, Block.vine.blockID, 8, 2);
}
if (var1.isAirBlock(var3 + 1, var4, var5))
{
var1.setBlock(var3 + 1, var4, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 1, var5))
{
var1.setBlock(var3 + 1, var4 - 1, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 2, var5))
{
var1.setBlock(var3 + 1, var4 - 2, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 3, var5))
{
var1.setBlock(var3 + 1, var4 - 3, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 4, var5))
{
var1.setBlock(var3 + 1, var4 - 4, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 5, var5))
{
var1.setBlock(var3 + 1, var4 - 5, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 6, var5))
{
var1.setBlock(var3 + 1, var4 - 6, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 7, var5))
{
var1.setBlock(var3 + 1, var4 - 7, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 8, var5))
{
var1.setBlock(var3 + 1, var4 - 8, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 9, var5))
{
var1.setBlock(var3 + 1, var4 - 9, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3 + 1, var4 - 10, var5))
{
var1.setBlock(var3 + 1, var4 - 10, var5, Block.vine.blockID, 2, 2);
}
if (var1.isAirBlock(var3, var4, var5 - 1))
{
var1.setBlock(var3, var4, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 1, var5 - 1))
{
var1.setBlock(var3, var4 - 1, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 2, var5 - 1))
{
var1.setBlock(var3, var4 - 2, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 3, var5 - 1))
{
var1.setBlock(var3, var4 - 3, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 4, var5 - 1))
{
var1.setBlock(var3, var4 - 4, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 5, var5 - 1))
{
var1.setBlock(var3, var4 - 5, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 6, var5 - 1))
{
var1.setBlock(var3, var4 - 6, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 7, var5 - 1))
{
var1.setBlock(var3, var4 - 7, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 8, var5 - 1))
{
var1.setBlock(var3, var4 - 8, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 9, var5 - 1))
{
var1.setBlock(var3, var4 - 9, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 10, var5 - 1))
{
var1.setBlock(var3, var4 - 10, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 11, var5 - 1))
{
var1.setBlock(var3, var4 - 11, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 12, var5 - 1))
{
var1.setBlock(var3, var4 - 12, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 13, var5 - 1))
{
var1.setBlock(var3, var4 - 13, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 14, var5 - 1))
{
var1.setBlock(var3, var4 - 14, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4 - 15, var5 - 1))
{
var1.setBlock(var3, var4 - 15, var5 - 1, Block.vine.blockID, 1, 2);
}
if (var1.isAirBlock(var3, var4, var5 + 1))
{
var1.setBlock(var3, var4, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 1, var5 + 1))
{
var1.setBlock(var3, var4 - 1, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 2, var5 + 1))
{
var1.setBlock(var3, var4 - 2, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 3, var5 + 1))
{
var1.setBlock(var3, var4 - 3, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 4, var5 + 1))
{
var1.setBlock(var3, var4 - 4, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 5, var5 + 1))
{
var1.setBlock(var3, var4 - 5, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 6, var5 + 1))
{
var1.setBlock(var3, var4 - 6, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 7, var5 + 1))
{
var1.setBlock(var3, var4 - 7, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 8, var5 + 1))
{
var1.setBlock(var3, var4 - 8, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 9, var5 + 1))
{
var1.setBlock(var3, var4 - 9, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 10, var5 + 1))
{
var1.setBlock(var3, var4 - 10, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 11, var5 + 1))
{
var1.setBlock(var3, var4 - 11, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 12, var5 + 1))
{
var1.setBlock(var3, var4 - 12, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 13, var5 + 1))
{
var1.setBlock(var3, var4 - 13, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 14, var5 + 1))
{
var1.setBlock(var3, var4 - 14, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 15, var5 + 1))
{
var1.setBlock(var3, var4 - 15, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 16, var5 + 1))
{
var1.setBlock(var3, var4 - 16, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 17, var5 + 1))
{
var1.setBlock(var3, var4 - 17, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 18, var5 + 1))
{
var1.setBlock(var3, var4 - 18, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 19, var5 + 1))
{
var1.setBlock(var3, var4 - 19, var5 + 1, Block.vine.blockID, 4, 2);
}
if (var1.isAirBlock(var3, var4 - 20, var5 + 1))
{
var1.setBlock(var3, var4 - 20, var5 + 1, Block.vine.blockID, 4, 2);
}
return true;
}
}
}