mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 08:46:44 +01:00
#771: Add clear weather World API
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
parent
d9f5dbb3e6
commit
7e0df16cfe
1 changed files with 17 additions and 0 deletions
|
@ -1283,6 +1283,7 @@ public class CraftWorld implements World {
|
|||
public void setStorm(boolean hasStorm) {
|
||||
world.worldData.setStorm(hasStorm);
|
||||
setWeatherDuration(0); // Reset weather duration (legacy behaviour)
|
||||
setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1304,6 +1305,7 @@ public class CraftWorld implements World {
|
|||
public void setThundering(boolean thundering) {
|
||||
world.worldDataServer.setThundering(thundering);
|
||||
setThunderDuration(0); // Reset weather duration (legacy behaviour)
|
||||
setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1316,6 +1318,21 @@ public class CraftWorld implements World {
|
|||
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
|
||||
public long getSeed() {
|
||||
return world.getSeed();
|
||||
|
|
Loading…
Add table
Reference in a new issue