BiomesOPlenty/common/biomesoplenty/worldgen/WorldGenMoss.java

41 lines
1,005 B
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty.worldgen;
import java.util.Random;
import net.minecraft.util.Direction;
import net.minecraft.util.Facing;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
2013-05-03 13:00:44 +00:00
public class WorldGenMoss 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 var6 = par3;
2013-05-03 13:00:44 +00:00
2013-05-31 10:34:02 +00:00
for (int var7 = par5; par4 < 80; ++par4)
{
if (par1World.isAirBlock(par3, par4, par5))
{
for (int var8 = 2; var8 <= 5; ++var8)
{
if (Blocks.moss.get().canPlaceBlockOnSide(par1World, par3, par4, par5, var8))
{
par1World.setBlock(par3, par4, par5, Blocks.moss.get().blockID, 1 << Direction.facingToDirection[Facing.oppositeSide[var8]], 2);
break;
}
}
}
else
{
par3 = var6 + par2Random.nextInt(4) - par2Random.nextInt(4);
par5 = var7 + par2Random.nextInt(4) - par2Random.nextInt(4);
}
}
2013-05-03 13:00:44 +00:00
2013-05-31 10:34:02 +00:00
return true;
}
2013-05-03 13:00:44 +00:00
}