@@ -3,18 +3,18 @@
|
||||
@@ -18,9 +18,12 @@
|
||||
}
|
||||
|
||||
public boolean a(int i, List<EntityPlayer> list) {
|
||||
- int j = (int) list.stream().filter(EntityHuman::isDeeplySleeping).count();
|
||||
public boolean areEnoughDeepSleeping(int i, List<EntityPlayer> list) {
|
||||
- int j = (int) list.stream().filter(EntityHuman::isSleepingLongEnough).count();
|
||||
+ // CraftBukkit start
|
||||
+ int j = (int) list.stream().filter((eh) -> { return eh.isDeeplySleeping() || eh.fauxSleeping; }).count();
|
||||
+ boolean anyDeepSleep = list.stream().anyMatch(EntityHuman::isDeeplySleeping);
|
||||
+ int j = (int) list.stream().filter((eh) -> { return eh.isSleepingLongEnough() || eh.fauxSleeping; }).count();
|
||||
+ boolean anyDeepSleep = list.stream().anyMatch(EntityHuman::isSleepingLongEnough);
|
||||
|
||||
- return j >= this.b(i);
|
||||
+ return anyDeepSleep && j >= this.b(i);
|
||||
- return j >= this.sleepersNeeded(i);
|
||||
+ return anyDeepSleep && j >= this.sleepersNeeded(i);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
public int b(int i) {
|
||||
public int sleepersNeeded(int i) {
|
||||
@@ -42,18 +45,24 @@
|
||||
this.activePlayers = 0;
|
||||
this.sleepingPlayers = 0;
|
||||
|
||||
Reference in New Issue
Block a user