From 7c5007c0165fc474ade015cfd9c1def26f12b462 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Mon, 3 Oct 2011 01:25:54 -0400 Subject: [PATCH] Added Difficulty API. --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index d4c23515f9..beb87eb619 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -34,6 +34,7 @@ import org.bukkit.TreeType; import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.generator.BlockPopulator; +import org.bukkit.Difficulty; public class CraftWorld implements World { private final WorldServer world; @@ -578,6 +579,14 @@ public class CraftWorld implements World { 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() { return world.worldData.hasStorm(); }