GenLayerRemoveTooMuchOcean .java

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

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

GenLayerRemoveTooMuchOcean.java46 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen.layer;
2
3
public class GenLayerRemoveTooMuchOcean extends GenLayer
4
{
5
    public GenLayerRemoveTooMuchOcean(long p_i45480_1_, GenLayer p_i45480_3_)
6
    {
7
        super(p_i45480_1_);
8
        this.parent = p_i45480_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 + 1 + (i1 + 1 - 1) * (areaWidth + 2)];
29
                int l1 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)];
30
                int i2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)];
31
                int j2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)];
32
                int k2 = aint[j1 + 1 + (i1 + 1) * k];
33
                aint1[j1 + i1 * areaWidth] = k2;
34
                this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY));
35
36
                if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && this.nextInt(2) == 0)
37
                {
38
                    aint1[j1 + i1 * areaWidth] = 1;
39
                }
40
            }
41
        }
42
43
        return aint1;
44
    }
45
}
46

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