GenLayerRareBiome .java

net.minecraft.world.gen.layer.GenLayerRareBiome (class, 50 lines): extends GenLayer. members: getInts. imports: BiomeGenBase.

net.minecraft.world.gen.layerclass50 linescommonextends GenLayer1.5 KB

API Surface (1)

int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)

Code Graph: Dependencies (3)

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

Full Source

GenLayerRareBiome.java50 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen.layer;
2
3
import net.minecraft.world.biome.BiomeGenBase;
4
5
public class GenLayerRareBiome extends GenLayer
6
{
7
    public GenLayerRareBiome(long p_i45478_1_, GenLayer p_i45478_3_)
8
    {
9
        super(p_i45478_1_);
10
        this.parent = p_i45478_3_;
11
    }
12
13
    /**
14
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
15
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
16
     */
17
    public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
18
    {
19
        int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2);
20
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
21
22
        for (int i = 0; i < areaHeight; ++i)
23
        {
24
            for (int j = 0; j < areaWidth; ++j)
25
            {
26
                this.initChunkSeed((long)(j + areaX), (long)(i + areaY));
27
                int k = aint[j + 1 + (i + 1) * (areaWidth + 2)];
28
29
                if (this.nextInt(57) == 0)
30
                {
31
                    if (k == BiomeGenBase.plains.biomeID)
32
                    {
33
                        aint1[j + i * areaWidth] = BiomeGenBase.plains.biomeID + 128;
34
                    }
35
                    else
36
                    {
37
                        aint1[j + i * areaWidth] = k;
38
                    }
39
                }
40
                else
41
                {
42
                    aint1[j + i * areaWidth] = k;
43
                }
44
            }
45
        }
46
47
        return aint1;
48
    }
49
}
50

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