BiomesOPlenty/common/biomesoplenty/worldgen/WorldGenCloud.java

55 lines
1.8 KiB
Java
Raw Normal View History

package biomesoplenty.worldgen;
import java.util.Random;
2013-11-09 21:20:35 +00:00
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
2013-11-09 21:20:35 +00:00
import biomesoplenty.api.Blocks;
public class WorldGenCloud extends WorldGenerator
{
2013-05-31 10:34:02 +00:00
@Override
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
int var998 = par2Random.nextInt(10);
2013-11-09 21:20:35 +00:00
if (var998 != 0)
{
return false;
}
for (int var6 = 0; var6 < 80; ++var6)
2013-05-31 10:34:02 +00:00
{
2013-11-09 21:20:35 +00:00
int var7 = par3 + par2Random.nextInt(12) - par2Random.nextInt(12);
int var8 = par4 + par2Random.nextInt(6) - par2Random.nextInt(6);
int var9 = par5 + par2Random.nextInt(12) - par2Random.nextInt(12);
2013-11-09 21:20:35 +00:00
int var999 = par2Random.nextInt(4);
if (var999 == 0)
2013-05-31 10:34:02 +00:00
{
2013-11-09 21:20:35 +00:00
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))
2013-05-31 10:34:02 +00:00
{
2013-11-09 21:20:35 +00:00
par1World.setBlock(var7, var8, var9, Blocks.cloud.get().blockID, 0, 2);
par1World.setBlock(var7 - 1, var8, var9, Blocks.cloud.get().blockID, 0, 2);
par1World.setBlock(var7 + 1, var8, var9, Blocks.cloud.get().blockID, 0, 2);
par1World.setBlock(var7, var8, var9 - 1, Blocks.cloud.get().blockID, 0, 2);
par1World.setBlock(var7, var8, var9 + 1, Blocks.cloud.get().blockID, 0, 2);
par1World.setBlock(var7, var8 - 1, var9, Blocks.cloud.get().blockID, 0, 2);
par1World.setBlock(var7, var8 + 1, var9, Blocks.cloud.get().blockID, 0, 2);
}
}
else
{
if (par1World.isAirBlock(var7, var8, var9))
{
par1World.setBlock(var7, var8, var9, Blocks.cloud.get().blockID, 0, 2);
2013-05-31 10:34:02 +00:00
}
}
}
2013-05-31 10:34:02 +00:00
return true;
}
}