GenLayerSmooth .java

net.minecraft.world.gen.layer.GenLayerSmooth (class, 67 lines): extends GenLayer. members: getInts.

net.minecraft.world.gen.layerclass67 linescommonextends GenLayer1.9 KB

API Surface (1)

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

Code Graph: Dependencies (2)

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

Full Source

GenLayerSmooth.java67 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen.layer;
2
3
public class GenLayerSmooth extends GenLayer
4
{
5
    public GenLayerSmooth(long p_i2131_1_, GenLayer p_i2131_3_)
6
    {
7
        super(p_i2131_1_);
8
        super.parent = p_i2131_3_;
9
    }
10
11
    /**
12
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
13
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
14
     */
15
    public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
16
    {
17
        int i = areaX - 1;
18
        int j = areaY - 1;
19
        int k = areaWidth + 2;
20
        int l = areaHeight + 2;
21
        int[] aint = this.parent.getInts(i, j, k, l);
22
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
23
24
        for (int i1 = 0; i1 < areaHeight; ++i1)
25
        {
26
            for (int j1 = 0; j1 < areaWidth; ++j1)
27
            {
28
                int k1 = aint[j1 + 0 + (i1 + 1) * k];
29
                int l1 = aint[j1 + 2 + (i1 + 1) * k];
30
                int i2 = aint[j1 + 1 + (i1 + 0) * k];
31
                int j2 = aint[j1 + 1 + (i1 + 2) * k];
32
                int k2 = aint[j1 + 1 + (i1 + 1) * k];
33
34
                if (k1 == l1 && i2 == j2)
35
                {
36
                    this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY));
37
38
                    if (this.nextInt(2) == 0)
39
                    {
40
                        k2 = k1;
41
                    }
42
                    else
43
                    {
44
                        k2 = i2;
45
                    }
46
                }
47
                else
48
                {
49
                    if (k1 == l1)
50
                    {
51
                        k2 = k1;
52
                    }
53
54
                    if (i2 == j2)
55
                    {
56
                        k2 = i2;
57
                    }
58
                }
59
60
                aint1[j1 + i1 * areaWidth] = k2;
61
            }
62
        }
63
64
        return aint1;
65
    }
66
}
67

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