Added the ability to majority sleep through a thunderstorm
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user