/
FireGen.java
32 lines (27 loc) · 1015 Bytes
/
FireGen.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package mods.natura.dimension;
import java.util.Random;
import mods.natura.common.NContent;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class FireGen extends WorldGenerator
{
@Override
public boolean generate (World world, Random par2Random, int x, int y, int z)
{
for (int l = 0; l < 64; ++l)
{
int xPos = x + par2Random.nextInt(8) - par2Random.nextInt(8);
int yPos = y + par2Random.nextInt(4) - par2Random.nextInt(4);
int zPos = z + par2Random.nextInt(8) - par2Random.nextInt(8);
if (world.isAirBlock(xPos, yPos, zPos))
{
Block blockID = world.getBlock(xPos, yPos - 1, zPos);
if (blockID == Blocks.netherrack || blockID == NContent.taintedSoil)
world.setBlock(xPos, yPos, zPos, Blocks.fire, 0, 2);
}
}
return true;
}
}