summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-04-22 03:13:21 -0700
committersk89q <the.sk89q@gmail.com>2011-04-22 03:13:21 -0700
commita042ee1e2629cad5ea32b5b56fe50ce44e4b94c6 (patch)
tree66d9371cab2a6e2bd9bdd6dec037caec5b435a99
parentc3ce6ce3ab07de8a958fdf0e6bc1802266d2c9af (diff)
downloadcraftbukkit-a042ee1e2629cad5ea32b5b56fe50ce44e4b94c6.tar
craftbukkit-a042ee1e2629cad5ea32b5b56fe50ce44e4b94c6.tar.gz
craftbukkit-a042ee1e2629cad5ea32b5b56fe50ce44e4b94c6.tar.lz
craftbukkit-a042ee1e2629cad5ea32b5b56fe50ce44e4b94c6.tar.xz
craftbukkit-a042ee1e2629cad5ea32b5b56fe50ce44e4b94c6.zip
Add methods to control thunder.
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index f6839116..357476ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -571,4 +571,27 @@ public class CraftWorld implements World {
public void setWeatherDuration(int duration) {
world.worldData.c(duration);
}
+
+ public boolean isThundering() {
+ return world.worldData.j();
+ }
+
+ public void setThundering(boolean thundering) {
+ world.worldData.a(thundering);
+
+ // These numbers are from Minecraft
+ if (thundering) {
+ setThunderDuration(rand.nextInt(12000) + 3600);
+ } else {
+ setThunderDuration(rand.nextInt(168000) + 12000);
+ }
+ }
+
+ public int getThunderDuration() {
+ return world.worldData.k();
+ }
+
+ public void setThunderDuration(int duration) {
+ world.worldData.b(duration);
+ }
}