GenLayerZoom .java

net.minecraft.world.gen.layer.GenLayerZoom (class, 71 lines): extends GenLayer. members: magnify, getInts.

net.minecraft.world.gen.layerclass71 linescommonextends GenLayer2.2 KB

API Surface (2)

int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
GenLayer magnify(long p_75915_0_, GenLayer p_75915_2_, int p_75915_3_)

Code Graph: Dependencies (2)

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

Full Source

GenLayerZoom.java71 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen.layer;
2
3
public class GenLayerZoom extends GenLayer
4
{
5
    public GenLayerZoom(long p_i2134_1_, GenLayer p_i2134_3_)
6
    {
7
        super(p_i2134_1_);
8
        super.parent = p_i2134_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 >> 1) + 2;
20
        int l = (areaHeight >> 1) + 2;
21
        int[] aint = this.parent.getInts(i, j, k, l);
22
        int i1 = k - 1 << 1;
23
        int j1 = l - 1 << 1;
24
        int[] aint1 = IntCache.getIntCache(i1 * j1);
25
26
        for (int k1 = 0; k1 < l - 1; ++k1)
27
        {
28
            int l1 = (k1 << 1) * i1;
29
            int i2 = 0;
30
            int j2 = aint[i2 + 0 + (k1 + 0) * k];
31
32
            for (int k2 = aint[i2 + 0 + (k1 + 1) * k]; i2 < k - 1; ++i2)
33
            {
34
                this.initChunkSeed((long)(i2 + i << 1), (long)(k1 + j << 1));
35
                int l2 = aint[i2 + 1 + (k1 + 0) * k];
36
                int i3 = aint[i2 + 1 + (k1 + 1) * k];
37
                aint1[l1] = j2;
38
                aint1[l1++ + i1] = this.selectRandom(new int[] {j2, k2});
39
                aint1[l1] = this.selectRandom(new int[] {j2, l2});
40
                aint1[l1++ + i1] = this.selectModeOrRandom(j2, l2, k2, i3);
41
                j2 = l2;
42
                k2 = i3;
43
            }
44
        }
45
46
        int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight);
47
48
        for (int j3 = 0; j3 < areaHeight; ++j3)
49
        {
50
            System.arraycopy(aint1, (j3 + (areaY & 1)) * i1 + (areaX & 1), aint2, j3 * areaWidth, areaWidth);
51
        }
52
53
        return aint2;
54
    }
55
56
    /**
57
     * Magnify a layer. Parms are seed adjustment, layer, number of times to magnify
58
     */
59
    public static GenLayer magnify(long p_75915_0_, GenLayer p_75915_2_, int p_75915_3_)
60
    {
61
        GenLayer genlayer = p_75915_2_;
62
63
        for (int i = 0; i < p_75915_3_; ++i)
64
        {
65
            genlayer = new GenLayerZoom(p_75915_0_ + (long)i, genlayer);
66
        }
67
68
        return genlayer;
69
    }
70
}
71

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