GeneratorBushFeature .java

net.minecraft.world.gen.GeneratorBushFeature (class, 33 lines): members: field_175908_a, generate. imports: BlockBush, WorldGenerator, World, BlockPos.

net.minecraft.world.genclass33 linescommonextends WorldGenerator1.0 KB

API Surface (1)

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

Fields & Constants (1)

field_175908_a

Code Graph: Dependencies (4)

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

Full Source

GeneratorBushFeature.java33 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen;
2
3
import java.util.Random;
4
import net.minecraft.block.BlockBush;
5
import net.minecraft.util.BlockPos;
6
import net.minecraft.world.World;
7
import net.minecraft.world.gen.feature.WorldGenerator;
8
9
public class GeneratorBushFeature extends WorldGenerator
10
{
11
    private BlockBush field_175908_a;
12
13
    public GeneratorBushFeature(BlockBush p_i45633_1_)
14
    {
15
        this.field_175908_a = p_i45633_1_;
16
    }
17
18
    public boolean generate(World worldIn, Random rand, BlockPos position)
19
    {
20
        for (int i = 0; i < 64; ++i)
21
        {
22
            BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
23
24
            if (worldIn.isAirBlock(blockpos) && (!worldIn.provider.getHasNoSky() || blockpos.getY() < 255) && this.field_175908_a.canBlockStay(worldIn, blockpos, this.field_175908_a.getDefaultState()))
25
            {
26
                worldIn.setBlockState(blockpos, this.field_175908_a.getDefaultState(), 2);
27
            }
28
        }
29
30
        return true;
31
    }
32
}
33

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