Archived
0

Added the ability to majority sleep through a thunderstorm

This commit is contained in:
Minenash
2019-01-07 16:48:06 -05:00
parent 1ffd4d43b5
commit 2750813de0

View File

@@ -43,7 +43,7 @@ public class Survival implements Module, Listener {
boolean suspendEvents = false; boolean suspendEvents = false;
public void checkSleep(World world) { public void checkSleep(World world) {
if (suspendEvents || isDay(world.getTime())) if (suspendEvents || !canSleep(world.getTime(), world.isThundering()))
return; return;
int sleepingPlayers = 0; int sleepingPlayers = 0;
@@ -72,8 +72,8 @@ public class Survival implements Module, Listener {
return true; return true;
} }
public boolean isDay(long time) { public boolean canSleep(long time, boolean thundering) {
return time < 12300 || time > 23850; return !(time < 12300 || time > 23850) || thundering;
} }
public void notifyPlayers(List<Player> players, String msg) { public void notifyPlayers(List<Player> players, String msg) {