GenLayerDeepOcean .java

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

net.minecraft.world.gen.layerclass71 linescommonextends GenLayer2.0 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

GenLayerDeepOcean.java71 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 GenLayerDeepOcean extends GenLayer
6
{
7
    public GenLayerDeepOcean(long p_i45472_1_, GenLayer p_i45472_3_)
8
    {
9
        super(p_i45472_1_);
10
        this.parent = p_i45472_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 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)];
31
                int l1 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)];
32
                int i2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)];
33
                int j2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)];
34
                int k2 = aint[j1 + 1 + (i1 + 1) * k];
35
                int l2 = 0;
36
37
                if (k1 == 0)
38
                {
39
                    ++l2;
40
                }
41
42
                if (l1 == 0)
43
                {
44
                    ++l2;
45
                }
46
47
                if (i2 == 0)
48
                {
49
                    ++l2;
50
                }
51
52
                if (j2 == 0)
53
                {
54
                    ++l2;
55
                }
56
57
                if (k2 == 0 && l2 > 3)
58
                {
59
                    aint1[j1 + i1 * areaWidth] = BiomeGenBase.deepOcean.biomeID;
60
                }
61
                else
62
                {
63
                    aint1[j1 + i1 * areaWidth] = k2;
64
                }
65
            }
66
        }
67
68
        return aint1;
69
    }
70
}
71

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