Paper/paper-server/nms-patches/net/minecraft/server/players/SleepStatus.patch
CraftBukkit/Spigot b3a8254758 Update to Minecraft 1.17
By: md_5 <git@md-5.net>
2021-06-11 15:00:00 +10:00

21 lines
848 B
Diff

--- a/net/minecraft/server/players/SleepStatus.java
+++ b/net/minecraft/server/players/SleepStatus.java
@@ -18,7 +18,7 @@
}
public boolean a(int i, List<EntityPlayer> list) {
- int j = (int) list.stream().filter(EntityHuman::isDeeplySleeping).count();
+ int j = (int) list.stream().filter((eh) -> { return eh.isDeeplySleeping() || eh.fauxSleeping; }).count(); // CraftBukkit
return j >= this.b(i);
}
@@ -46,7 +46,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
- if (!entityplayer.isSpectator()) {
+ if (!entityplayer.isSpectator() && !entityplayer.fauxSleeping) { // CraftBukkit
++this.activePlayers;
if (entityplayer.isSleeping()) {
++this.sleepingPlayers;