2011-11-20 09:01:14 +01:00
|
|
|
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) {}
|
|
|
|
|
2012-01-12 12:02:39 +01:00
|
|
|
// CraftBukkit - change signature
|
2012-01-14 21:03:48 +01:00
|
|
|
protected void setTypeAndData(BlockChangeDelegate world, int i, int j, int k, int l, int i1) {
|
2011-11-20 09:01:14 +01:00
|
|
|
if (this.a) {
|
2012-03-14 03:38:39 +01:00
|
|
|
world.setTypeIdAndData(i, j, k, l, i1);
|
2012-03-21 22:01:11 +01:00
|
|
|
// CraftBukkit start - do equiv of setTypeIdAndData, but skip doing physics to prevent fades
|
|
|
|
}
|
|
|
|
else if ((world instanceof World) && ((World) world).getChunkAt(i >> 4, k >> 4).sentToClient) {
|
|
|
|
if (world.setRawTypeIdAndData(i, j, k, l, i1)) {
|
|
|
|
((World) world).notify(i, j, k);
|
|
|
|
}
|
|
|
|
// CraftBukkt end
|
2011-11-20 09:01:14 +01:00
|
|
|
} else {
|
|
|
|
world.setRawTypeIdAndData(i, j, k, l, i1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|