Changed how quicksand generates. Allowed tiny cacti and thorns to "live" at any light level (For the Nether).

This commit is contained in:
Matt Caughey 2013-05-28 20:19:44 -04:00
parent 31246c579f
commit a2c5944287
15 changed files with 131 additions and 137 deletions

View file

@ -58,7 +58,6 @@ import biomesoplenty.worldgen.WorldGenPotatoes;
import biomesoplenty.worldgen.WorldGenPromisedWillow;
import biomesoplenty.worldgen.WorldGenQuagmire;
import biomesoplenty.worldgen.WorldGenQuicksand;
import biomesoplenty.worldgen.WorldGenQuicksand2;
import biomesoplenty.worldgen.WorldGenReedBOP;
import biomesoplenty.worldgen.WorldGenShield;
import biomesoplenty.worldgen.WorldGenSmolderingGrass;
@ -133,6 +132,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected WorldGenerator driedDirtInSandGen;
protected WorldGenerator clayInStoneGen;
protected WorldGenerator quagmireGen;
protected WorldGenerator quicksandGen;
protected WorldGenerator canyonGen;
protected WorldGenerator cloudGen;
protected WorldGenerator coalGen;
@ -194,8 +194,6 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected WorldGenerator desertSproutsGen;
protected WorldGenerator promisedWillowGen;
protected WorldGenerator netherVineGen;
protected WorldGenerator quicksandGen;
protected WorldGenerator quicksand2Gen;
protected WorldGenerator poisonIvyGen;
protected WorldGenerator sunflowerGen;
protected WorldGenerator crystalGen;
@ -272,8 +270,6 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected int desertSproutsPerChunk;
protected int promisedWillowPerChunk;
protected int netherVinesPerChunk;
protected int quicksandPerChunk;
protected int quicksand2PerChunk;
protected int poisonIvyPerChunk;
protected int sunflowersPerChunk;
@ -361,6 +357,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
public boolean generateMelons;
public boolean generateBoulders;
public boolean generateClouds;
public boolean generateQuicksand;
public BiomeDecoratorBOP(BiomeGenBase par1BiomeGenBase)
{
@ -382,6 +379,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.sandInStoneGen = new WorldGenMinable(Block.sand.blockID, 32);
this.clayInStoneGen = new WorldGenMinable(Block.blockClay.blockID, 32);
this.quagmireGen = new WorldGenQuagmire(Block.grass.blockID, 48);
this.quicksandGen = new WorldGenQuicksand(Blocks.mud.get().blockID, 24);
this.canyonGen = new WorldGenCanyon(Blocks.redRock.get().blockID, 48);
this.driedDirtInSandGen = new WorldGenDriedDirt(Blocks.driedDirt.get().blockID, 32);
this.cloudGen = new WorldGenCloud(Blocks.cloud.get().blockID, 48);
@ -419,8 +417,6 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.sunflowerGen = new WorldGenSunflower(Blocks.flowers.get().blockID, 13);
this.promisedWillowGen = new WorldGenPromisedWillow();
this.netherVineGen = new WorldGenNetherVines();
this.quicksandGen = new WorldGenQuicksand();
this.quicksand2Gen = new WorldGenQuicksand2();
this.cattailGen = new WorldGenCattail();
this.crystalGen = new WorldGenCrystal1();
this.crystalGen2 = new WorldGenCrystal2();
@ -518,8 +514,6 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.netherLavaPerChunk = 0;
this.hotSpringsPerChunk = 0;
this.poisonWaterPerChunk = 0;
this.quicksandPerChunk = 0;
this.quicksand2PerChunk = 0;
this.crystalsPerChunk = 0;
this.crystals2PerChunk = 0;
this.generateLakes = true;
@ -537,6 +531,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.generateMelons = false;
this.generateBoulders = false;
this.generateClouds = false;
this.generateQuicksand = false;
this.biome = par1BiomeGenBase;
}
@ -615,6 +610,19 @@ public class BiomeDecoratorBOP extends BiomeDecorator
(new WorldGenLakes(Liquids.springWaterFlowing.get().blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < 5; ++var2)
{
int var9999 = this.randomGenerator.nextInt(32);
if (var9999 == 1)
{
var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
var4 = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(32) + 8) + 8);
var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
(new WorldGenLakes(Liquids.springWaterFlowing.get().blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
}
for (var2 = 0; var2 < poisonWaterPerChunk; ++var2)
{
var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
@ -683,6 +691,11 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.genStandardOre1(15, this.canyonGen, 64, 128);
}
if (this.generateQuicksand)
{
this.genStandardOre1(5, this.quicksandGen, 64, 128);
}
if (this.generateClouds)
{
this.genCloudMain(1, this.cloudGen, 0, 50);
@ -1070,22 +1083,6 @@ public class BiomeDecoratorBOP extends BiomeDecorator
var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
this.plantDesertGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < this.quicksandPerChunk; ++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.quicksandGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < this.quicksand2PerChunk; ++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.quicksand2Gen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
//Added
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS);

View file

@ -24,7 +24,7 @@ public class BiomeGenAlps extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = -999;
this.customBiomeDecorator.sandPerChunk = -999;
this.customBiomeDecorator.sandPerChunk2 = -999;
this.customBiomeDecorator.hotSpringsPerChunk = 2;
this.customBiomeDecorator.hotSpringsPerChunk = 4;
}
/**

View file

@ -23,6 +23,7 @@ public class BiomeGenBrushland extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 6;
this.customBiomeDecorator.thornsPerChunk = 4;
this.customBiomeDecorator.flowersPerChunk = -999;
this.customBiomeDecorator.generateQuicksand = true;
}
/**

View file

@ -25,7 +25,7 @@ public class BiomeGenDesertNew extends BiomeGenBase
this.customBiomeDecorator.cactiPerChunk = 10;
this.customBiomeDecorator.desertSproutsPerChunk = 1;
this.customBiomeDecorator.tinyCactiPerChunk = 5;
this.customBiomeDecorator.quicksand2PerChunk = 3;
this.customBiomeDecorator.generateQuicksand = true;
this.customBiomeDecorator.aloePerChunk = 2;
}

View file

@ -33,7 +33,6 @@ public class BiomeGenJungleNew extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 25;
this.customBiomeDecorator.flowersPerChunk = 4;
this.customBiomeDecorator.orangeFlowersPerChunk = 5;
this.customBiomeDecorator.quicksandPerChunk = 1;
this.customBiomeDecorator.poisonIvyPerChunk = 1;
this.customBiomeDecorator.generateMelons = true;
this.waterColorMultiplier = 10745289;

View file

@ -37,7 +37,7 @@ public class BiomeGenMysticGrove extends BiomeGenBase
this.customBiomeDecorator.blueMilksPerChunk = 4;
this.customBiomeDecorator.glowshroomsPerChunk = 2;
this.customBiomeDecorator.lilyflowersPerChunk = 3;
this.customBiomeDecorator.hotSpringsPerChunk = 5;
this.customBiomeDecorator.hotSpringsPerChunk = 2;
this.waterColorMultiplier = 15349914;
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();

View file

@ -30,8 +30,8 @@ public class BiomeGenOasis extends BiomeGenBase
this.customBiomeDecorator.tinyCactiPerChunk = 2;
this.customBiomeDecorator.generatePumpkins = false;
this.customBiomeDecorator.generateMelons = true;
this.customBiomeDecorator.generateQuicksand = true;
this.customBiomeDecorator.waterLakesPerChunk = 10;
this.customBiomeDecorator.quicksand2PerChunk = 2;
this.customBiomeDecorator.aloePerChunk = 4;
this.customBiomeDecorator.hotSpringsPerChunk = 2;
}

View file

@ -28,7 +28,6 @@ public class BiomeGenOutback extends BiomeGenBase
this.customBiomeDecorator.deadBushPerChunk = 7;
this.customBiomeDecorator.tinyCactiPerChunk = 2;
this.customBiomeDecorator.bushesPerChunk = 5;
this.customBiomeDecorator.quicksandPerChunk = 1;
this.customBiomeDecorator.generatePumpkins = false;
}

View file

@ -26,7 +26,7 @@ public class BiomeGenSteppe extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 15;
this.customBiomeDecorator.deadBushPerChunk = 7;
this.customBiomeDecorator.tinyCactiPerChunk = 1;
this.customBiomeDecorator.quicksandPerChunk = 1;
this.customBiomeDecorator.generateQuicksand = true;
this.customBiomeDecorator.steppePerChunk = 6;
this.customBiomeDecorator.aloePerChunk = 2;
this.customBiomeDecorator.generatePumpkins = false;

View file

@ -35,7 +35,7 @@ public class BiomeGenTropicalRainforest extends BiomeGenBase
this.customBiomeDecorator.generatePumpkins = false;
this.customBiomeDecorator.generateMelons = true;
this.customBiomeDecorator.sproutsPerChunk = 2;
this.customBiomeDecorator.quicksandPerChunk = 3;
this.customBiomeDecorator.generateQuicksand = true;
this.customBiomeDecorator.poisonIvyPerChunk = 4;
this.customBiomeDecorator.lilyflowersPerChunk = 2;
this.spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6));

View file

@ -266,12 +266,30 @@ public class BlockBOPFlower extends BlockFlower
@Override
public boolean canBlockStay(World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (world.getBlockId(x, y, z) != this.blockID)
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
{
if (meta == 11)
{
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
}
else
{
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
}
}
else
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
{
if (meta == 11)
{
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
}
else
{
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
}
}
}
@Override

View file

@ -165,12 +165,30 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
@Override
public boolean canBlockStay(World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (world.getBlockId(x, y, z) != this.blockID)
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
{
if (meta == 5)
{
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
}
else
{
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
}
}
else
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
{
if (meta == 5)
{
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
}
else
{
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
}
}
}
@Override

View file

@ -2,61 +2,80 @@ package biomesoplenty.worldgen;
import java.util.Random;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import net.minecraft.block.Block;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
public class WorldGenQuicksand extends WorldGenerator
{
public boolean generate(World var1, Random var2, int var3, int var4, int var5)
/** The block ID of the ore to be placed using this generator. */
private int minableBlockId;
/** The number of blocks to generate. */
private int numberOfBlocks;
public WorldGenQuicksand(int par1, int par2)
{
while (var1.isAirBlock(var3, var4, var5) && var4 > 2)
{
--var4;
}
this.minableBlockId = par1;
this.numberOfBlocks = par2;
}
int var6 = var1.getBlockId(var3, var4, var5);
int var96 = var1.getBlockId(var3 - 1, var4, var5);
int var97 = var1.getBlockId(var3 + 1, var4, var5);
int var98 = var1.getBlockId(var3, var4, var5 - 1);
int var99 = var1.getBlockId(var3, var4, var5 + 1);
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
float var6 = par2Random.nextFloat() * (float)Math.PI;
double var7 = (double)((float)(par3 + 8) + MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F);
double var9 = (double)((float)(par3 + 8) - MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F);
double var11 = (double)((float)(par5 + 8) + MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F);
double var13 = (double)((float)(par5 + 8) - MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F);
double var15 = (double)(par4 + par2Random.nextInt(3) - 2);
double var17 = (double)(par4 + par2Random.nextInt(3) - 2);
if (var6 != Block.grass.blockID && var96 != Block.grass.blockID && var97 != Block.grass.blockID && var98 != Block.grass.blockID && var99 != Block.grass.blockID)
for (int var19 = 0; var19 <= this.numberOfBlocks; ++var19)
{
return false;
}
else
{
for (int var7 = -2; var7 <= 2; ++var7)
double var20 = var7 + (var9 - var7) * (double)var19 / (double)this.numberOfBlocks;
double var22 = var15 + (var17 - var15) * (double)var19 / (double)this.numberOfBlocks;
double var24 = var11 + (var13 - var11) * (double)var19 / (double)this.numberOfBlocks;
double var26 = par2Random.nextDouble() * (double)this.numberOfBlocks / 16.0D;
double var28 = (double)(MathHelper.sin((float)var19 * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * var26 + 1.0D;
double var30 = (double)(MathHelper.sin((float)var19 * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * var26 + 1.0D;
int var32 = MathHelper.floor_double(var20 - var28 / 2.0D);
int var33 = MathHelper.floor_double(var22 - var30 / 2.0D);
int var34 = MathHelper.floor_double(var24 - var28 / 2.0D);
int var35 = MathHelper.floor_double(var20 + var28 / 2.0D);
int var36 = MathHelper.floor_double(var22 + var30 / 2.0D);
int var37 = MathHelper.floor_double(var24 + var28 / 2.0D);
for (int var38 = var32; var38 <= var35; ++var38)
{
for (int var8 = -2; var8 <= 2; ++var8)
double var39 = ((double)var38 + 0.5D - var20) / (var28 / 2.0D);
if (var39 * var39 < 1.0D)
{
if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8))
for (int var41 = var33; var41 <= var36; ++var41)
{
return false;
double var42 = ((double)var41 + 0.5D - var22) / (var30 / 2.0D);
if (var39 * var39 + var42 * var42 < 1.0D)
{
for (int var44 = var34; var44 <= var37; ++var44)
{
double var45 = ((double)var44 + 0.5D - var24) / (var28 / 2.0D);
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (par1World.getBlockId(var38, var41, var44) == Block.grass.blockID || par1World.getBlockId(var38, var41, var44) == Block.sand.blockID))
{
this.setBlockAndMetadata(par1World, var38, var41, var44, this.minableBlockId, 1);
}
}
}
}
}
}
var1.setBlock(var3, var4 - 3, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 2, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 1, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4, var5, 0);
var1.setBlock(var3 - 1, var4 - 2, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3 + 1, var4 - 2, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 2, var5 - 1, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 2, var5 + 1, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3 - 1, var4 - 1, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3 + 1, var4 - 1, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 1, var5 - 1, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 1, var5 + 1, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3 - 1, var4, var5, 0);
var1.setBlock(var3 + 1, var4, var5, 0);
var1.setBlock(var3, var4, var5 - 1, 0);
var1.setBlock(var3, var4, var5 + 1, 0);
return true;
}
return true;
}
}

View file

@ -1,57 +0,0 @@
package biomesoplenty.worldgen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
public class WorldGenQuicksand2 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);
int var96 = var1.getBlockId(var3 - 1, var4, var5);
int var97 = var1.getBlockId(var3 + 1, var4, var5);
int var98 = var1.getBlockId(var3, var4, var5 - 1);
int var99 = var1.getBlockId(var3, var4, var5 + 1);
if (var6 != Block.sand.blockID && var96 != Block.sand.blockID && var97 != Block.sand.blockID && var98 != Block.sand.blockID && var99 != Block.sand.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;
}
}
}
var1.setBlock(var3, var4 - 2, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 1, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3 - 1, var4 - 1, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3 + 1, var4 - 1, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 1, var5 - 1, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4 - 1, var5 + 1, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3 - 1, var4, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3 + 1, var4, var5, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4, var5 - 1, Blocks.mud.get().blockID, 1, 2);
var1.setBlock(var3, var4, var5 + 1, Blocks.mud.get().blockID, 1, 2);
return true;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 372 B