summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/WorldGenerator.java
blob: ffb18f7f990955e0ad1898d6c9f2e107b86827bb (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
32
33
34
35
36
37
38
39
40
41
42
43
package net.minecraft.server;

import java.util.Random;

import org.bukkit.BlockChangeDelegate; // CraftBukkit

public abstract class WorldGenerator {

    private final boolean a;

    public WorldGenerator() {
        this.a = false;
    }

    public WorldGenerator(boolean flag) {
        this.a = flag;
    }

    public abstract boolean a(World world, Random random, int i, int j, int k);

    public void a(double d0, double d1, double d2) {}

    // CraftBukkit - change signature
    protected void setType(BlockChangeDelegate world, int i, int j, int k, int l) {
        this.setTypeAndData(world, i, j, k, l, 0);
    }

    // CraftBukkit - change signature
    protected void setTypeAndData(BlockChangeDelegate world, int i, int j, int k, int l, int i1) {
        if (this.a) {
            // CraftBukkit - BlockChangeDelegate doesn't have the 6th parameter
            world.setTypeIdAndData(i, j, k, l, i1);
        } else {
            // CraftBukkit start - Layering violation :(
            if (world instanceof World) {
                ((World) world).setTypeIdAndData(i, j, k, l, i1, 2);
            } else {
                world.setRawTypeIdAndData(i, j, k, l, i1);
            }
            // CraftBukkit end
        }
    }
}