GenLayerAddMushroomIsland .java

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

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

GenLayerAddMushroomIsland.java51 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 GenLayerAddMushroomIsland extends GenLayer
6
{
7
    public GenLayerAddMushroomIsland(long p_i2120_1_, GenLayer p_i2120_3_)
8
    {
9
        super(p_i2120_1_);
10
        this.parent = p_i2120_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 + 0 + (i1 + 0) * k];
31
                int l1 = aint[j1 + 2 + (i1 + 0) * k];
32
                int i2 = aint[j1 + 0 + (i1 + 2) * k];
33
                int j2 = aint[j1 + 2 + (i1 + 2) * k];
34
                int k2 = aint[j1 + 1 + (i1 + 1) * k];
35
                this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY));
36
37
                if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && this.nextInt(100) == 0)
38
                {
39
                    aint1[j1 + i1 * areaWidth] = BiomeGenBase.mushroomIsland.biomeID;
40
                }
41
                else
42
                {
43
                    aint1[j1 + i1 * areaWidth] = k2;
44
                }
45
            }
46
        }
47
48
        return aint1;
49
    }
50
}
51

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