diff options
author | md_5 <git@md-5.net> | 2015-01-13 20:40:23 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2015-01-13 20:40:23 +1100 |
commit | 93e7b199bd213eeb66004961c167951b24d246e9 (patch) | |
tree | 92dda450fc1418b80e0679e4ecb2be79c0cfcca0 /src/main/java/org/bukkit | |
parent | 0643caa8883535174f3e7672b5514525b23a0fbf (diff) | |
download | craftbukkit-93e7b199bd213eeb66004961c167951b24d246e9.tar craftbukkit-93e7b199bd213eeb66004961c167951b24d246e9.tar.gz craftbukkit-93e7b199bd213eeb66004961c167951b24d246e9.tar.lz craftbukkit-93e7b199bd213eeb66004961c167951b24d246e9.tar.xz craftbukkit-93e7b199bd213eeb66004961c167951b24d246e9.zip |
Fix the CraftWorld weather methods duplicating events.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 066c681c..e7d0588b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -751,20 +751,7 @@ public class CraftWorld implements World { } public void setStorm(boolean hasStorm) { - CraftServer server = world.getServer(); - - WeatherChangeEvent weather = new WeatherChangeEvent(this, hasStorm); - server.getPluginManager().callEvent(weather); - if (!weather.isCancelled()) { - world.worldData.setStorm(hasStorm); - - // These numbers are from Minecraft - if (hasStorm) { - setWeatherDuration(rand.nextInt(12000) + 12000); - } else { - setWeatherDuration(rand.nextInt(168000) + 12000); - } - } + world.worldData.setStorm(hasStorm); } public int getWeatherDuration() { @@ -780,21 +767,7 @@ public class CraftWorld implements World { } public void setThundering(boolean thundering) { - if (thundering && !hasStorm()) setStorm(true); - CraftServer server = world.getServer(); - - ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering); - server.getPluginManager().callEvent(thunder); - if (!thunder.isCancelled()) { - world.worldData.setThundering(thundering); - - // These numbers are from Minecraft - if (thundering) { - setThunderDuration(rand.nextInt(12000) + 3600); - } else { - setThunderDuration(rand.nextInt(168000) + 12000); - } - } + world.worldData.setThundering(thundering); } public int getThunderDuration() { |