Fix the CraftWorld weather methods duplicating events.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2015-01-13 20:40:23 +11:00
parent fb01afbadc
commit 7f26add625
2 changed files with 11 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde/net/minecraft/server/WorldData.java 2015-01-05 09:50:01.989188327 +1100
+++ src/main/java/net/minecraft/server/WorldData.java 2015-01-05 09:50:01.993188321 +1100
--- ../work/decompile-8eb82bde/net/minecraft/server/WorldData.java 2015-01-13 20:36:38.880978444 +1100
+++ src/main/java/net/minecraft/server/WorldData.java 2015-01-13 20:36:38.880978444 +1100
@@ -1,6 +1,9 @@
package net.minecraft.server;
@@ -10,7 +10,7 @@
public class WorldData {
@@ -395,6 +398,16 @@
@@ -395,6 +398,18 @@
}
public void setThundering(boolean flag) {
@@ -22,12 +22,14 @@
+ if (thunder.isCancelled()) {
+ return;
+ }
+
+ setThunderDuration(0); // Will force a time reset
+ }
+ // CraftBukkit end
this.s = flag;
}
@@ -411,6 +424,16 @@
@@ -411,6 +426,18 @@
}
public void setStorm(boolean flag) {
@@ -39,12 +41,14 @@
+ if (weather.isCancelled()) {
+ return;
+ }
+
+ setWeatherDuration(0); // Will force a time reset
+ }
+ // CraftBukkit end
this.q = flag;
}
@@ -645,4 +668,12 @@
@@ -645,4 +672,12 @@
static boolean q(WorldData worlddata) {
return worlddata.x;
}