WorldGenerator .java

net.minecraft.world.gen.feature.WorldGenerator (class): members: setBlockAndNotifyAdequately, doBlockNotify, func_175904_e, generate. imports: IBlockState.

net.minecraft.world.gen.featureclass44 linescommon1.0 KB

API Surface (2)

void func_175904_e()
void setBlockAndNotifyAdequately(World worldIn, BlockPos pos, IBlockState state)

Fields & Constants (1)

doBlockNotify

Code Graph: Dependencies (3)

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

Full Source

WorldGenerator.java44 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen.feature;
2
3
import java.util.Random;
4
import net.minecraft.block.state.IBlockState;
5
import net.minecraft.util.BlockPos;
6
import net.minecraft.world.World;
7
8
public abstract class WorldGenerator
9
{
10
    /**
11
     * Sets wither or not the generator should notify blocks of blocks it changes. When the world is first generated,
12
     * this is false, when saplings grow, this is true.
13
     */
14
    private final boolean doBlockNotify;
15
16
    public WorldGenerator()
17
    {
18
        this(false);
19
    }
20
21
    public WorldGenerator(boolean notify)
22
    {
23
        this.doBlockNotify = notify;
24
    }
25
26
    public abstract boolean generate(World worldIn, Random rand, BlockPos position);
27
28
    public void func_175904_e()
29
    {
30
    }
31
32
    protected void setBlockAndNotifyAdequately(World worldIn, BlockPos pos, IBlockState state)
33
    {
34
        if (this.doBlockNotify)
35
        {
36
            worldIn.setBlockState(pos, state, 3);
37
        }
38
        else
39
        {
40
            worldIn.setBlockState(pos, state, 2);
41
        }
42
    }
43
}
44

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