New cloud generation
This commit is contained in:
parent
493d37a463
commit
2e3ca5e045
|
@ -348,6 +348,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
public int rootsPerChunk;
|
public int rootsPerChunk;
|
||||||
public int stalagmitesPerChunk;
|
public int stalagmitesPerChunk;
|
||||||
public int stalactitesPerChunk;
|
public int stalactitesPerChunk;
|
||||||
|
public int cloudsPerChunk;
|
||||||
|
|
||||||
public int boneSpinesPerChunk;
|
public int boneSpinesPerChunk;
|
||||||
public int boneSpines2PerChunk;
|
public int boneSpines2PerChunk;
|
||||||
|
@ -471,7 +472,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
spongeGen = new WorldGenSponge(Block.sponge.blockID, 24);
|
spongeGen = new WorldGenSponge(Block.sponge.blockID, 24);
|
||||||
canyonGen = new WorldGenCanyon(Blocks.redRock.get().blockID, 48);
|
canyonGen = new WorldGenCanyon(Blocks.redRock.get().blockID, 48);
|
||||||
driedDirtInSandGen = new WorldGenDriedDirt(Blocks.driedDirt.get().blockID, 32);
|
driedDirtInSandGen = new WorldGenDriedDirt(Blocks.driedDirt.get().blockID, 32);
|
||||||
cloudGen = new WorldGenCloud(Blocks.cloud.get().blockID, 48);
|
cloudGen = new WorldGenCloud();
|
||||||
coalGen = new WorldGenMinable(Block.oreCoal.blockID, 16);
|
coalGen = new WorldGenMinable(Block.oreCoal.blockID, 16);
|
||||||
ironGen = new WorldGenMinable(Block.oreIron.blockID, 8);
|
ironGen = new WorldGenMinable(Block.oreIron.blockID, 8);
|
||||||
goldGen = new WorldGenMinable(Block.oreGold.blockID, 8);
|
goldGen = new WorldGenMinable(Block.oreGold.blockID, 8);
|
||||||
|
@ -659,6 +660,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
rootsPerChunk = 9;
|
rootsPerChunk = 9;
|
||||||
stalagmitesPerChunk = 5;
|
stalagmitesPerChunk = 5;
|
||||||
stalactitesPerChunk = 10;
|
stalactitesPerChunk = 10;
|
||||||
|
cloudsPerChunk = 0;
|
||||||
generateLakes = true;
|
generateLakes = true;
|
||||||
generateAsh = false;
|
generateAsh = false;
|
||||||
generateMycelium = false;
|
generateMycelium = false;
|
||||||
|
@ -1365,6 +1367,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
stalactiteGen.generate(currentWorld, randomGenerator, var3, var4, var5);
|
stalactiteGen.generate(currentWorld, randomGenerator, var3, var4, var5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (var2 = 0; var2 < cloudsPerChunk; ++var2)
|
||||||
|
{
|
||||||
|
var3 = chunk_X + randomGenerator.nextInt(16) + 8;
|
||||||
|
var4 = randomGenerator.nextInt(32);
|
||||||
|
var5 = chunk_Z + randomGenerator.nextInt(16) + 8;
|
||||||
|
cloudGen.generate(currentWorld, randomGenerator, var3, var4, var5);
|
||||||
|
}
|
||||||
|
|
||||||
for (var2 = 0; var2 < waspHivesPerChunk; ++var2)
|
for (var2 = 0; var2 < waspHivesPerChunk; ++var2)
|
||||||
{
|
{
|
||||||
int var420 = randomGenerator.nextInt(4);
|
int var420 = randomGenerator.nextInt(4);
|
||||||
|
|
|
@ -41,12 +41,13 @@ public class BiomeGenPromisedLandForest extends BiomeGenBase implements IWCFog
|
||||||
customBiomeDecorator.waterLakesPerChunk = 10;
|
customBiomeDecorator.waterLakesPerChunk = 10;
|
||||||
customBiomeDecorator.crystalsPerChunk = 25;
|
customBiomeDecorator.crystalsPerChunk = 25;
|
||||||
customBiomeDecorator.crystals2PerChunk = 50;
|
customBiomeDecorator.crystals2PerChunk = 50;
|
||||||
|
customBiomeDecorator.cloudsPerChunk = 1;
|
||||||
spawnableCreatureList.clear();
|
spawnableCreatureList.clear();
|
||||||
spawnableWaterCreatureList.clear();
|
spawnableWaterCreatureList.clear();
|
||||||
spawnableMonsterList.clear();
|
spawnableMonsterList.clear();
|
||||||
spawnableCaveCreatureList.clear();
|
spawnableCaveCreatureList.clear();
|
||||||
customBiomeDecorator.generatePumpkins = false;
|
customBiomeDecorator.generatePumpkins = false;
|
||||||
this.customBiomeDecorator.generateClouds = true;
|
//customBiomeDecorator.generateClouds = true;
|
||||||
//this.customBiomeDecorator.generateLakes = false;
|
//this.customBiomeDecorator.generateLakes = false;
|
||||||
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
|
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
|
||||||
/*this.spawnableMonsterList.add(new SpawnListEntry(EntityCow.class, 6, 1, 4));
|
/*this.spawnableMonsterList.add(new SpawnListEntry(EntityCow.class, 6, 1, 4));
|
||||||
|
@ -91,7 +92,7 @@ public class BiomeGenPromisedLandForest extends BiomeGenBase implements IWCFog
|
||||||
@Override
|
@Override
|
||||||
public int getFogColour()
|
public int getFogColour()
|
||||||
{
|
{
|
||||||
return 16765286;
|
return 16754234;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -37,12 +37,13 @@ public class BiomeGenPromisedLandPlains extends BiomeGenBase implements IWCFog
|
||||||
customBiomeDecorator.waterLakesPerChunk = 3;
|
customBiomeDecorator.waterLakesPerChunk = 3;
|
||||||
customBiomeDecorator.crystalsPerChunk = 25;
|
customBiomeDecorator.crystalsPerChunk = 25;
|
||||||
customBiomeDecorator.crystals2PerChunk = 50;
|
customBiomeDecorator.crystals2PerChunk = 50;
|
||||||
|
customBiomeDecorator.cloudsPerChunk = 1;
|
||||||
spawnableCreatureList.clear();
|
spawnableCreatureList.clear();
|
||||||
spawnableWaterCreatureList.clear();
|
spawnableWaterCreatureList.clear();
|
||||||
spawnableMonsterList.clear();
|
spawnableMonsterList.clear();
|
||||||
spawnableCaveCreatureList.clear();
|
spawnableCaveCreatureList.clear();
|
||||||
customBiomeDecorator.generatePumpkins = false;
|
customBiomeDecorator.generatePumpkins = false;
|
||||||
this.customBiomeDecorator.generateClouds = true;
|
//customBiomeDecorator.generateClouds = true;
|
||||||
//this.customBiomeDecorator.generateLakes = false;
|
//this.customBiomeDecorator.generateLakes = false;
|
||||||
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
|
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
|
||||||
|
|
||||||
|
@ -80,13 +81,13 @@ public class BiomeGenPromisedLandPlains extends BiomeGenBase implements IWCFog
|
||||||
@Override
|
@Override
|
||||||
public int getBiomeFoliageColor()
|
public int getBiomeFoliageColor()
|
||||||
{
|
{
|
||||||
return 11266663;
|
return 7925125;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getFogColour()
|
public int getFogColour()
|
||||||
{
|
{
|
||||||
return 16765286;
|
return 16754234;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -42,12 +42,13 @@ public class BiomeGenPromisedLandSwamp extends BiomeGenBase implements IWCFog
|
||||||
customBiomeDecorator.waterLakesPerChunk = 15;
|
customBiomeDecorator.waterLakesPerChunk = 15;
|
||||||
customBiomeDecorator.crystalsPerChunk = 25;
|
customBiomeDecorator.crystalsPerChunk = 25;
|
||||||
customBiomeDecorator.crystals2PerChunk = 50;
|
customBiomeDecorator.crystals2PerChunk = 50;
|
||||||
|
customBiomeDecorator.cloudsPerChunk = 1;
|
||||||
spawnableCreatureList.clear();
|
spawnableCreatureList.clear();
|
||||||
spawnableWaterCreatureList.clear();
|
spawnableWaterCreatureList.clear();
|
||||||
spawnableMonsterList.clear();
|
spawnableMonsterList.clear();
|
||||||
spawnableCaveCreatureList.clear();
|
spawnableCaveCreatureList.clear();
|
||||||
customBiomeDecorator.generatePumpkins = false;
|
customBiomeDecorator.generatePumpkins = false;
|
||||||
this.customBiomeDecorator.generateClouds = true;
|
//customBiomeDecorator.generateClouds = true;
|
||||||
//this.customBiomeDecorator.generateLakes = false;
|
//this.customBiomeDecorator.generateLakes = false;
|
||||||
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
|
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
|
||||||
/*this.spawnableMonsterList.add(new SpawnListEntry(EntityPig.class, 4, 1, 4));
|
/*this.spawnableMonsterList.add(new SpawnListEntry(EntityPig.class, 4, 1, 4));
|
||||||
|
@ -85,13 +86,13 @@ public class BiomeGenPromisedLandSwamp extends BiomeGenBase implements IWCFog
|
||||||
@Override
|
@Override
|
||||||
public int getBiomeFoliageColor()
|
public int getBiomeFoliageColor()
|
||||||
{
|
{
|
||||||
return 4583331;
|
return 7925125;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getFogColour()
|
public int getFogColour()
|
||||||
{
|
{
|
||||||
return 16765286;
|
return 16754234;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,78 +2,49 @@ package biomesoplenty.worldgen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.util.MathHelper;
|
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;
|
||||||
|
import biomesoplenty.api.Blocks;
|
||||||
|
|
||||||
public class WorldGenCloud extends WorldGenerator
|
public class WorldGenCloud extends WorldGenerator
|
||||||
{
|
{
|
||||||
/** 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 WorldGenCloud(int par1, int par2)
|
|
||||||
{
|
|
||||||
minableBlockId = par1;
|
|
||||||
numberOfBlocks = par2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
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)
|
||||||
{
|
{
|
||||||
float var6 = par2Random.nextFloat() * (float)Math.PI;
|
int var998 = par2Random.nextInt(7);
|
||||||
double var7 = par3 + 8 + MathHelper.sin(var6) * numberOfBlocks / 8.0F;
|
|
||||||
double var9 = par3 + 8 - MathHelper.sin(var6) * numberOfBlocks / 8.0F;
|
if (var998 != 0)
|
||||||
double var11 = par5 + 8 + MathHelper.cos(var6) * numberOfBlocks / 8.0F;
|
|
||||||
double var13 = par5 + 8 - MathHelper.cos(var6) * numberOfBlocks / 8.0F;
|
|
||||||
double var15 = par4 + par2Random.nextInt(9) - 2;
|
|
||||||
double var17 = par4 + par2Random.nextInt(9) - 2;
|
|
||||||
|
|
||||||
for (int var19 = 0; var19 <= numberOfBlocks; ++var19)
|
|
||||||
{
|
{
|
||||||
double var20 = var7 + (var9 - var7) * var19 / numberOfBlocks;
|
return false;
|
||||||
double var22 = var15 + (var17 - var15) * var19 / numberOfBlocks;
|
}
|
||||||
double var24 = var11 + (var13 - var11) * var19 / numberOfBlocks;
|
|
||||||
double var26 = par2Random.nextDouble() * numberOfBlocks / 32.0D;
|
for (int var6 = 0; var6 < 80; ++var6)
|
||||||
double var28 = (MathHelper.sin(var19 * (float)Math.PI / numberOfBlocks) + 1.0F) * var26 + 1.0D;
|
{
|
||||||
double var30 = (MathHelper.sin(var19 * (float)Math.PI / numberOfBlocks) + 1.0F) * var26 + 1.0D;
|
int var7 = par3 + par2Random.nextInt(12) - par2Random.nextInt(12);
|
||||||
int var32 = MathHelper.floor_double(var20 - var28 / 1.0D);
|
int var8 = par4 + par2Random.nextInt(6) - par2Random.nextInt(6);
|
||||||
int var33 = MathHelper.floor_double(var22 - var30 / 1.0D);
|
int var9 = par5 + par2Random.nextInt(12) - par2Random.nextInt(12);
|
||||||
int var34 = MathHelper.floor_double(var24 - var28 / 1.0D);
|
|
||||||
int var35 = MathHelper.floor_double(var20 + var28 / 1.0D);
|
|
||||||
int var36 = MathHelper.floor_double(var22 + var30 / 1.0D);
|
|
||||||
int var37 = MathHelper.floor_double(var24 + var28 / 1.0D);
|
|
||||||
|
|
||||||
for (int var38 = var32; var38 <= var35; ++var38)
|
int var999 = par2Random.nextInt(4);
|
||||||
|
|
||||||
|
if (var999 == 0)
|
||||||
{
|
{
|
||||||
double var39 = (var38 + 0.5D - var20) / (var28 / 1.0D);
|
if (par1World.isAirBlock(var7, var8, var9) && par1World.isAirBlock(var7 - 1, var8, var9) && par1World.isAirBlock(var7 + 1, var8, var9) && par1World.isAirBlock(var7, var8, var9 - 1) && par1World.isAirBlock(var7, var8, var9 + 1) && par1World.isAirBlock(var7, var8 - 1, var9) && par1World.isAirBlock(var7, var8 + 1, var9))
|
||||||
|
|
||||||
if (var39 * var39 < 1.0D)
|
|
||||||
{
|
{
|
||||||
for (int var41 = var33; var41 <= var36; ++var41)
|
par1World.setBlock(var7, var8, var9, Blocks.cloud.get().blockID, 0, 2);
|
||||||
{
|
par1World.setBlock(var7 - 1, var8, var9, Blocks.cloud.get().blockID, 0, 2);
|
||||||
double var42 = (var41 + 0.5D - var22) / (var30 / 1.0D);
|
par1World.setBlock(var7 + 1, var8, var9, Blocks.cloud.get().blockID, 0, 2);
|
||||||
|
par1World.setBlock(var7, var8, var9 - 1, Blocks.cloud.get().blockID, 0, 2);
|
||||||
if (var39 * var39 + var42 * var42 < 1.0D)
|
par1World.setBlock(var7, var8, var9 + 1, Blocks.cloud.get().blockID, 0, 2);
|
||||||
{
|
par1World.setBlock(var7, var8 - 1, var9, Blocks.cloud.get().blockID, 0, 2);
|
||||||
for (int var44 = var34; var44 <= var37; ++var44)
|
par1World.setBlock(var7, var8 + 1, var9, Blocks.cloud.get().blockID, 0, 2);
|
||||||
{
|
}
|
||||||
double var45 = (var44 + 0.5D - var24) / (var28 / 1.0D);
|
}
|
||||||
|
else
|
||||||
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && par1World.isAirBlock(var38, var41, var44))
|
{
|
||||||
{
|
if (par1World.isAirBlock(var7, var8, var9))
|
||||||
//int var999 = par2Random.nextInt(45);
|
{
|
||||||
|
par1World.setBlock(var7, var8, var9, Blocks.cloud.get().blockID, 0, 2);
|
||||||
//if (var999 == 0)
|
|
||||||
//{
|
|
||||||
par1World.setBlock(var38, var41, var44, minableBlockId);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue