#771: Add clear weather World API
This commit is contained in:
parent
424598d294
commit
e1ebdd927a
@ -1283,6 +1283,7 @@ public class CraftWorld implements World {
|
|||||||
public void setStorm(boolean hasStorm) {
|
public void setStorm(boolean hasStorm) {
|
||||||
world.worldData.setStorm(hasStorm);
|
world.worldData.setStorm(hasStorm);
|
||||||
setWeatherDuration(0); // Reset weather duration (legacy behaviour)
|
setWeatherDuration(0); // Reset weather duration (legacy behaviour)
|
||||||
|
setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1304,6 +1305,7 @@ public class CraftWorld implements World {
|
|||||||
public void setThundering(boolean thundering) {
|
public void setThundering(boolean thundering) {
|
||||||
world.worldDataServer.setThundering(thundering);
|
world.worldDataServer.setThundering(thundering);
|
||||||
setThunderDuration(0); // Reset weather duration (legacy behaviour)
|
setThunderDuration(0); // Reset weather duration (legacy behaviour)
|
||||||
|
setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1316,6 +1318,21 @@ public class CraftWorld implements World {
|
|||||||
world.worldDataServer.setThunderDuration(duration);
|
world.worldDataServer.setThunderDuration(duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isClearWeather() {
|
||||||
|
return !this.hasStorm() && !this.isThundering();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setClearWeatherDuration(int duration) {
|
||||||
|
world.worldDataServer.a(duration); // PAIL rename setClearWeatherDuration
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getClearWeatherDuration() {
|
||||||
|
return world.worldDataServer.h(); // PAIL rename getClearWeatherDuration
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getSeed() {
|
public long getSeed() {
|
||||||
return world.getSeed();
|
return world.getSeed();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user