aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java
blob: 93c8404bb6086ce7ba7c9023d8caab30a62c3102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package gtPlusPlus.everglades.biome;

import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;

public class GenLayerBiomes extends GenLayer {

    protected BiomeGenBase[] allowedBiomes = { Biome_Everglades.biome, };

    public GenLayerBiomes(long seed) {
        super(seed);
    }

    public GenLayerBiomes(long seed, GenLayer genlayer) {
        super(seed);
        this.parent = genlayer;
    }

    @Override
    public int[] getInts(int x, int z, int width, int depth) {
        int[] dest = IntCache.getIntCache(width * depth);
        for (int dz = 0; dz < depth; dz++) {
            for (int dx = 0; dx < width; dx++) {
                this.initChunkSeed(dx + x, dz + z);
                dest[(dx + dz * width)] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
            }
        }
        return dest;
    }
}