mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 07:34:48 +01:00
Add methods to control thunder.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
8f0c812b0a
commit
42fedb41a8
1 changed files with 23 additions and 0 deletions
|
@ -571,4 +571,27 @@ public class CraftWorld implements World {
|
||||||
public void setWeatherDuration(int duration) {
|
public void setWeatherDuration(int duration) {
|
||||||
world.worldData.c(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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue