WorldGenFire .java

net.minecraft.world.gen.feature.WorldGenFire (class, 25 lines): extends WorldGenerator. members: generate. imports: Blocks.

net.minecraft.world.gen.featureclass25 linescommonextends WorldGenerator774 B

API Surface (1)

boolean generate(World worldIn, Random rand, BlockPos position)

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

WorldGenFire.java25 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen.feature;
2
3
import java.util.Random;
4
import net.minecraft.init.Blocks;
5
import net.minecraft.util.BlockPos;
6
import net.minecraft.world.World;
7
8
public class WorldGenFire extends WorldGenerator
9
{
10
    public boolean generate(World worldIn, Random rand, BlockPos position)
11
    {
12
        for (int i = 0; i < 64; ++i)
13
        {
14
            BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
15
16
            if (worldIn.isAirBlock(blockpos) && worldIn.getBlockState(blockpos.down()).getBlock() == Blocks.netherrack)
17
            {
18
                worldIn.setBlockState(blockpos, Blocks.fire.getDefaultState(), 2);
19
            }
20
        }
21
22
        return true;
23
    }
24
}
25

Deobfuscated MCP 1.8.9 source of WorldGenFire from Marcelektro/MavenMCP-1.8.9 (net/minecraft/world/gen/feature/WorldGenFire.java), stored verbatim.