Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -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;