MapGenBase .java

net.minecraft.world.gen.MapGenBase (class): members: range, recursiveGenerate, rand, worldObj, generate. imports: IChunkProvider, ChunkPrimer, World.

net.minecraft.world.genclass46 linescommon1.3 KB

API Surface (2)

void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)

Fields & Constants (3)

range
rand
worldObj

Code Graph: Dependencies (3)

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

Full Source

MapGenBase.java46 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen;
2
3
import java.util.Random;
4
import net.minecraft.world.World;
5
import net.minecraft.world.chunk.ChunkPrimer;
6
import net.minecraft.world.chunk.IChunkProvider;
7
8
public class MapGenBase
9
{
10
    /** The number of Chunks to gen-check in any given direction. */
11
    protected int range = 8;
12
13
    /** The RNG used by the MapGen classes. */
14
    protected Random rand = new Random();
15
16
    /** This world object. */
17
    protected World worldObj;
18
19
    public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
20
    {
21
        int i = this.range;
22
        this.worldObj = worldIn;
23
        this.rand.setSeed(worldIn.getSeed());
24
        long j = this.rand.nextLong();
25
        long k = this.rand.nextLong();
26
27
        for (int l = x - i; l <= x + i; ++l)
28
        {
29
            for (int i1 = z - i; i1 <= z + i; ++i1)
30
            {
31
                long j1 = (long)l * j;
32
                long k1 = (long)i1 * k;
33
                this.rand.setSeed(j1 ^ k1 ^ worldIn.getSeed());
34
                this.recursiveGenerate(worldIn, l, i1, x, z, chunkPrimerIn);
35
            }
36
        }
37
    }
38
39
    /**
40
     * Recursively called by generate()
41
     */
42
    protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
43
    {
44
    }
45
}
46

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