2013-05-10 18:50:44 +00:00
|
|
|
package biomesoplenty.worldgen;
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
2013-11-09 21:20:35 +00:00
|
|
|
import net.minecraft.block.Block;
|
2013-05-10 18:50:44 +00:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
2013-11-09 21:20:35 +00:00
|
|
|
import biomesoplenty.api.Blocks;
|
2013-05-10 18:50:44 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2013-11-09 21:20:35 +00:00
|
|
|
int var998 = par2Random.nextInt(7);
|
|
|
|
|
|
|
|
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-05-10 18:50:44 +00:00
|
|
|
|
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-10 18:50:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
return true;
|
|
|
|
}
|
2013-05-10 18:50:44 +00:00
|
|
|
}
|