Added Difficulty API.
By: EvilSeph <evilseph@gmail.com>
This commit is contained in:
parent
6e38cffca0
commit
a4242b3e90
1 changed files with 9 additions and 0 deletions
|
@ -34,6 +34,7 @@ import org.bukkit.TreeType;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
|
import org.bukkit.Difficulty;
|
||||||
|
|
||||||
public class CraftWorld implements World {
|
public class CraftWorld implements World {
|
||||||
private final WorldServer world;
|
private final WorldServer world;
|
||||||
|
@ -578,6 +579,14 @@ public class CraftWorld implements World {
|
||||||
world.savingDisabled = !value;
|
world.savingDisabled = !value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDifficulty(Difficulty difficulty) {
|
||||||
|
this.getHandle().difficulty = difficulty.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Difficulty getDifficulty() {
|
||||||
|
return Difficulty.getByValue(this.getHandle().difficulty);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasStorm() {
|
public boolean hasStorm() {
|
||||||
return world.worldData.hasStorm();
|
return world.worldData.hasStorm();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue