summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinenash <minenash@protonmail.com>2019-01-07 16:48:06 -0500
committerMinenash <minenash@protonmail.com>2019-01-07 16:48:06 -0500
commit2750813de0e8b2209d1284924412b317c5926332 (patch)
tree4ab04b13e66613034cacccbc733ce38acbeb91ea
parent1ffd4d43b5708893ddba26535efdffcb59d728f2 (diff)
Added the ability to majority sleep through a thunderstorm
-rw-r--r--src/main/java/com/redstoner/modules/survival/Survival.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/redstoner/modules/survival/Survival.java b/src/main/java/com/redstoner/modules/survival/Survival.java
index b7fa7ae..bf80208 100644
--- a/src/main/java/com/redstoner/modules/survival/Survival.java
+++ b/src/main/java/com/redstoner/modules/survival/Survival.java
@@ -43,7 +43,7 @@ public class Survival implements Module, Listener {
boolean suspendEvents = false;
public void checkSleep(World world) {
- if (suspendEvents || isDay(world.getTime()))
+ if (suspendEvents || !canSleep(world.getTime(), world.isThundering()))
return;
int sleepingPlayers = 0;
@@ -72,8 +72,8 @@ public class Survival implements Module, Listener {
return true;
}
- public boolean isDay(long time) {
- return time < 12300 || time > 23850;
+ public boolean canSleep(long time, boolean thundering) {
+ return !(time < 12300 || time > 23850) || thundering;
}
public void notifyPlayers(List<Player> players, String msg) {