From a042ee1e2629cad5ea32b5b56fe50ce44e4b94c6 Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 22 Apr 2011 03:13:21 -0700 Subject: [PATCH] Add methods to control thunder. --- .../org/bukkit/craftbukkit/CraftWorld.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index f6839116ea..357476ed3d 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); + } }