WorldGenWaterlily .java

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

net.minecraft.world.gen.featureclass27 linescommonextends WorldGenerator872 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

WorldGenWaterlily.java27 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 WorldGenWaterlily extends WorldGenerator
9
{
10
    public boolean generate(World worldIn, Random rand, BlockPos position)
11
    {
12
        for (int i = 0; i < 10; ++i)
13
        {
14
            int j = position.getX() + rand.nextInt(8) - rand.nextInt(8);
15
            int k = position.getY() + rand.nextInt(4) - rand.nextInt(4);
16
            int l = position.getZ() + rand.nextInt(8) - rand.nextInt(8);
17
18
            if (worldIn.isAirBlock(new BlockPos(j, k, l)) && Blocks.waterlily.canPlaceBlockAt(worldIn, new BlockPos(j, k, l)))
19
            {
20
                worldIn.setBlockState(new BlockPos(j, k, l), Blocks.waterlily.getDefaultState(), 2);
21
            }
22
        }
23
24
        return true;
25
    }
26
}
27

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