BiomesOPlenty/src/minecraft/biomesoplenty/worldgen/WorldGenSmolderingGrass.java

48 lines
1.5 KiB
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty.worldgen;
import java.util.Random;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
2013-05-21 00:49:30 +00:00
import net.minecraft.block.Block;
2013-05-03 13:00:44 +00:00
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenSmolderingGrass extends WorldGenerator
{
/** Stores ID for WorldGenTallGrass */
private int tallGrassID;
private int tallGrassMetadata;
2013-05-03 13:00:44 +00:00
public WorldGenSmolderingGrass(int par1, int par2)
2013-05-03 13:00:44 +00:00
{
this.tallGrassID = par1;
this.tallGrassMetadata = par2;
2013-05-03 13:00:44 +00:00
}
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
int var11;
2013-05-03 13:00:44 +00:00
for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4)
2013-05-03 13:00:44 +00:00
{
;
}
2013-05-03 13:00:44 +00:00
for (int var7 = 0; var7 < 128; ++var7)
{
int var8 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
int var9 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
int var10 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
2013-05-03 13:00:44 +00:00
if (par1World.isAirBlock(var8, var9, var10) && (par1World.getBlockId(var8, var9 - 1, var10) == Blocks.ash.get().blockID || par1World.getBlockId(var8, var9 - 1, var10) == Block.netherrack.blockID))
{
par1World.setBlock(var8, var9 - 1, var10, Blocks.holyGrass.get().blockID, 1, 2);
2013-05-03 13:00:44 +00:00
}
}
return true;
}
}