GenLayerRiver .java

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

net.minecraft.world.gen.layerclass55 linescommonextends GenLayer1.7 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

GenLayerRiver.java55 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 GenLayerRiver extends GenLayer
6
{
7
    public GenLayerRiver(long p_i2128_1_, GenLayer p_i2128_3_)
8
    {
9
        super(p_i2128_1_);
10
        super.parent = p_i2128_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 i = areaX - 1;
20
        int j = areaY - 1;
21
        int k = areaWidth + 2;
22
        int l = areaHeight + 2;
23
        int[] aint = this.parent.getInts(i, j, k, l);
24
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
25
26
        for (int i1 = 0; i1 < areaHeight; ++i1)
27
        {
28
            for (int j1 = 0; j1 < areaWidth; ++j1)
29
            {
30
                int k1 = this.func_151630_c(aint[j1 + 0 + (i1 + 1) * k]);
31
                int l1 = this.func_151630_c(aint[j1 + 2 + (i1 + 1) * k]);
32
                int i2 = this.func_151630_c(aint[j1 + 1 + (i1 + 0) * k]);
33
                int j2 = this.func_151630_c(aint[j1 + 1 + (i1 + 2) * k]);
34
                int k2 = this.func_151630_c(aint[j1 + 1 + (i1 + 1) * k]);
35
36
                if (k2 == k1 && k2 == i2 && k2 == l1 && k2 == j2)
37
                {
38
                    aint1[j1 + i1 * areaWidth] = -1;
39
                }
40
                else
41
                {
42
                    aint1[j1 + i1 * areaWidth] = BiomeGenBase.river.biomeID;
43
                }
44
            }
45
        }
46
47
        return aint1;
48
    }
49
50
    private int func_151630_c(int p_151630_1_)
51
    {
52
        return p_151630_1_ >= 2 ? 2 + (p_151630_1_ & 1) : p_151630_1_;
53
    }
54
}
55

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