BiomeGenHills .java

net.minecraft.world.biome.BiomeGenHills (class): members: theWorldGenerator, field_150634_aD, field_150635_aE, field_150636_aF, field_150637_aG, decorate.

net.minecraft.world.biomeclass104 linescommonextends BiomeGenBase3.6 KB

API Surface (4)

WorldGenAbstractTree genBigTreeChance(Random rand)
void decorate(World worldIn, Random rand, BlockPos pos)
void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
BiomeGenBase createMutatedBiome(int p_180277_1_)

Fields & Constants (6)

theWorldGenerator
field_150634_aD
field_150635_aE
field_150636_aF
field_150637_aG
field_150638_aH

Full Source

BiomeGenHills.java104 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.biome;
2
3
import java.util.Random;
4
import net.minecraft.block.BlockSilverfish;
5
import net.minecraft.init.Blocks;
6
import net.minecraft.util.BlockPos;
7
import net.minecraft.world.World;
8
import net.minecraft.world.chunk.ChunkPrimer;
9
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
10
import net.minecraft.world.gen.feature.WorldGenMinable;
11
import net.minecraft.world.gen.feature.WorldGenTaiga2;
12
import net.minecraft.world.gen.feature.WorldGenerator;
13
14
public class BiomeGenHills extends BiomeGenBase
15
{
16
    private WorldGenerator theWorldGenerator = new WorldGenMinable(Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.STONE), 9);
17
    private WorldGenTaiga2 field_150634_aD = new WorldGenTaiga2(false);
18
    private int field_150635_aE = 0;
19
    private int field_150636_aF = 1;
20
    private int field_150637_aG = 2;
21
    private int field_150638_aH;
22
23
    protected BiomeGenHills(int id, boolean p_i45373_2_)
24
    {
25
        super(id);
26
        this.field_150638_aH = this.field_150635_aE;
27
28
        if (p_i45373_2_)
29
        {
30
            this.theBiomeDecorator.treesPerChunk = 3;
31
            this.field_150638_aH = this.field_150636_aF;
32
        }
33
    }
34
35
    public WorldGenAbstractTree genBigTreeChance(Random rand)
36
    {
37
        return (WorldGenAbstractTree)(rand.nextInt(3) > 0 ? this.field_150634_aD : super.genBigTreeChance(rand));
38
    }
39
40
    public void decorate(World worldIn, Random rand, BlockPos pos)
41
    {
42
        super.decorate(worldIn, rand, pos);
43
        int i = 3 + rand.nextInt(6);
44
45
        for (int j = 0; j < i; ++j)
46
        {
47
            int k = rand.nextInt(16);
48
            int l = rand.nextInt(28) + 4;
49
            int i1 = rand.nextInt(16);
50
            BlockPos blockpos = pos.add(k, l, i1);
51
52
            if (worldIn.getBlockState(blockpos).getBlock() == Blocks.stone)
53
            {
54
                worldIn.setBlockState(blockpos, Blocks.emerald_ore.getDefaultState(), 2);
55
            }
56
        }
57
58
        for (i = 0; i < 7; ++i)
59
        {
60
            int j1 = rand.nextInt(16);
61
            int k1 = rand.nextInt(64);
62
            int l1 = rand.nextInt(16);
63
            this.theWorldGenerator.generate(worldIn, rand, pos.add(j1, k1, l1));
64
        }
65
    }
66
67
    public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
68
    {
69
        this.topBlock = Blocks.grass.getDefaultState();
70
        this.fillerBlock = Blocks.dirt.getDefaultState();
71
72
        if ((noiseVal < -1.0D || noiseVal > 2.0D) && this.field_150638_aH == this.field_150637_aG)
73
        {
74
            this.topBlock = Blocks.gravel.getDefaultState();
75
            this.fillerBlock = Blocks.gravel.getDefaultState();
76
        }
77
        else if (noiseVal > 1.0D && this.field_150638_aH != this.field_150636_aF)
78
        {
79
            this.topBlock = Blocks.stone.getDefaultState();
80
            this.fillerBlock = Blocks.stone.getDefaultState();
81
        }
82
83
        this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
84
    }
85
86
    /**
87
     * this creates a mutation specific to Hills biomes
88
     */
89
    private BiomeGenHills mutateHills(BiomeGenBase p_150633_1_)
90
    {
91
        this.field_150638_aH = this.field_150637_aG;
92
        this.func_150557_a(p_150633_1_.color, true);
93
        this.setBiomeName(p_150633_1_.biomeName + " M");
94
        this.setHeight(new BiomeGenBase.Height(p_150633_1_.minHeight, p_150633_1_.maxHeight));
95
        this.setTemperatureRainfall(p_150633_1_.temperature, p_150633_1_.rainfall);
96
        return this;
97
    }
98
99
    protected BiomeGenBase createMutatedBiome(int p_180277_1_)
100
    {
101
        return (new BiomeGenHills(p_180277_1_, false)).mutateHills(this);
102
    }
103
}
104

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