Paper/patches/server/0594-add-isDeeplySleeping-to-HumanEntity.patch

25 lines
978 B
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Thu, 8 Apr 2021 17:36:10 -0700
Subject: [PATCH] add isDeeplySleeping to HumanEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
2023-03-15 00:10:18 +01:00
index 539708d5d806c757305bee754d9a4f0de49a742f..b326654ef96cfd3f5cff476203844c2fb932b9b6 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
2023-03-15 00:10:18 +01:00
@@ -132,6 +132,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
2021-06-11 14:02:28 +02:00
}
2023-03-14 23:13:41 +01:00
// Paper end
2021-06-11 14:02:28 +02:00
+ // Paper start
2023-03-15 00:10:18 +01:00
+ @Override
2021-06-11 14:02:28 +02:00
+ public boolean isDeeplySleeping() {
+ return getHandle().isSleepingLongEnough();
+ }
+ // Paper end
+
@Override
public int getSleepTicks() {
2021-06-15 04:59:31 +02:00
return this.getHandle().sleepCounter;