mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 11:56:40 +00:00
Biome clean up & fixes
Change BiomeType to an interface. Do not longer use invalid biomes of Bukkit Biome enum. Add a common unknown biome type.
This commit is contained in:
@ -23,14 +23,18 @@ import org.spout.api.generator.biome.BiomeType;
|
||||
/**
|
||||
* @author zml2008
|
||||
*/
|
||||
public class SpoutBiomeType extends com.sk89q.worldedit.BiomeType {
|
||||
public class SpoutBiomeType implements com.sk89q.worldedit.BiomeType {
|
||||
private final BiomeType type;
|
||||
|
||||
public SpoutBiomeType(BiomeType type) {
|
||||
super(type.getName().toLowerCase().replace(" ", ""));
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return type.getName().toLowerCase().replace(" ", "");
|
||||
}
|
||||
|
||||
public BiomeType getSpoutBiome() {
|
||||
return type;
|
||||
}
|
||||
|
@ -206,11 +206,12 @@ public class SpoutWorld extends LocalWorld {
|
||||
BiomeGenerator gen = (BiomeGenerator) world.getGenerator();
|
||||
return new SpoutBiomeType(gen.getBiome(pt.getBlockX(), pt.getBlockZ(), world.getSeed()));
|
||||
}
|
||||
return new BiomeType("Unknown");
|
||||
return BiomeType.UNKNOWN;
|
||||
}
|
||||
|
||||
public void setBiome(Vector2D pt, BiomeType biome) {
|
||||
if (world.getGenerator() instanceof BiomeGenerator) {
|
||||
if (biome instanceof SpoutBiomeType &&
|
||||
world.getGenerator() instanceof BiomeGenerator) {
|
||||
BiomeGenerator gen = (BiomeGenerator) world.getGenerator();
|
||||
gen.setBiome(new Vector3(pt.getBlockX(), 0, pt.getBlockZ()), ((SpoutBiomeType) biome).getSpoutBiome());
|
||||
}
|
||||
|
Reference in New Issue
Block a user