WorldChunkManagerHell .java

net.minecraft.world.biome.WorldChunkManagerHell (class, 95 lines): members: biomeGenerator, getBiomesForGeneration, loadBlockGeneratorData, getBiomeGenAt.

net.minecraft.world.biomeclass95 linescommonextends WorldChunkManager3.0 KB

API Surface (7)

BiomeGenBase getBiomeGenerator(BlockPos pos)
BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] biomes, int x, int z, int width, int height)
float[] getRainfall(float[] listToReuse, int x, int z, int width, int length)
BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth)
BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int z, int width, int length, boolean cacheFlag)
BlockPos findBiomePosition(int x, int z, int range, List<BiomeGenBase> biomes, Random random)
boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List<BiomeGenBase> p_76940_4_)

Fields & Constants (2)

biomeGenerator
rainfall

Code Graph: Dependencies (3)

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

Full Source

WorldChunkManagerHell.java95 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.biome;
2
3
import java.util.Arrays;
4
import java.util.List;
5
import java.util.Random;
6
import net.minecraft.util.BlockPos;
7
8
public class WorldChunkManagerHell extends WorldChunkManager
9
{
10
    /** The biome generator object. */
11
    private BiomeGenBase biomeGenerator;
12
13
    /** The rainfall in the world */
14
    private float rainfall;
15
16
    public WorldChunkManagerHell(BiomeGenBase p_i45374_1_, float p_i45374_2_)
17
    {
18
        this.biomeGenerator = p_i45374_1_;
19
        this.rainfall = p_i45374_2_;
20
    }
21
22
    /**
23
     * Returns the biome generator
24
     */
25
    public BiomeGenBase getBiomeGenerator(BlockPos pos)
26
    {
27
        return this.biomeGenerator;
28
    }
29
30
    /**
31
     * Returns an array of biomes for the location input.
32
     */
33
    public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] biomes, int x, int z, int width, int height)
34
    {
35
        if (biomes == null || biomes.length < width * height)
36
        {
37
            biomes = new BiomeGenBase[width * height];
38
        }
39
40
        Arrays.fill(biomes, 0, width * height, this.biomeGenerator);
41
        return biomes;
42
    }
43
44
    /**
45
     * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.
46
     */
47
    public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length)
48
    {
49
        if (listToReuse == null || listToReuse.length < width * length)
50
        {
51
            listToReuse = new float[width * length];
52
        }
53
54
        Arrays.fill(listToReuse, 0, width * length, this.rainfall);
55
        return listToReuse;
56
    }
57
58
    /**
59
     * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the
60
     * WorldChunkManager Args: oldBiomeList, x, z, width, depth
61
     */
62
    public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth)
63
    {
64
        if (oldBiomeList == null || oldBiomeList.length < width * depth)
65
        {
66
            oldBiomeList = new BiomeGenBase[width * depth];
67
        }
68
69
        Arrays.fill(oldBiomeList, 0, width * depth, this.biomeGenerator);
70
        return oldBiomeList;
71
    }
72
73
    /**
74
     * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
75
     * don't check biomeCache to avoid infinite loop in BiomeCacheBlock)
76
     */
77
    public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int z, int width, int length, boolean cacheFlag)
78
    {
79
        return this.loadBlockGeneratorData(listToReuse, x, z, width, length);
80
    }
81
82
    public BlockPos findBiomePosition(int x, int z, int range, List<BiomeGenBase> biomes, Random random)
83
    {
84
        return biomes.contains(this.biomeGenerator) ? new BlockPos(x - range + random.nextInt(range * 2 + 1), 0, z - range + random.nextInt(range * 2 + 1)) : null;
85
    }
86
87
    /**
88
     * checks given Chunk's Biomes against List of allowed ones
89
     */
90
    public boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List<BiomeGenBase> p_76940_4_)
91
    {
92
        return p_76940_4_.contains(this.biomeGenerator);
93
    }
94
}
95

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