From 08d5c44532dc793d4787354577af535b87a16041 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 22 Apr 2021 09:32:40 -0700 Subject: [PATCH] Add isDeeplySleeping to HumanEntity (#5470) --- .../add-isDeeplySleeping-to-HumanEntity.patch | 26 +++++++++++++++++++ .../add-isDeeplySleeping-to-HumanEntity.patch | 24 +++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Spigot-API-Patches/add-isDeeplySleeping-to-HumanEntity.patch create mode 100644 Spigot-Server-Patches/add-isDeeplySleeping-to-HumanEntity.patch diff --git a/Spigot-API-Patches/add-isDeeplySleeping-to-HumanEntity.patch b/Spigot-API-Patches/add-isDeeplySleeping-to-HumanEntity.patch new file mode 100644 index 000000000..b38c9afe8 --- /dev/null +++ b/Spigot-API-Patches/add-isDeeplySleeping-to-HumanEntity.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Thu, 8 Apr 2021 17:36:15 -0700 +Subject: [PATCH] add isDeeplySleeping to HumanEntity + + +diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/HumanEntity.java ++++ b/src/main/java/org/bukkit/entity/HumanEntity.java +@@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder + */ + public void setCooldown(@NotNull Material material, int ticks); + ++ // Paper start ++ /** ++ * If the player has slept enough to count towards passing the night. ++ * ++ * @return true if the player has slept enough ++ */ ++ public boolean isDeeplySleeping(); ++ // Paper end ++ + /** + * Get the sleep ticks of the player. This value may be capped. + * diff --git a/Spigot-Server-Patches/add-isDeeplySleeping-to-HumanEntity.patch b/Spigot-Server-Patches/add-isDeeplySleeping-to-HumanEntity.patch new file mode 100644 index 000000000..527787e29 --- /dev/null +++ b/Spigot-Server-Patches/add-isDeeplySleeping-to-HumanEntity.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +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 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +@@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { + } + } + ++ // Paper start ++ @Override ++ public boolean isDeeplySleeping() { ++ return getHandle().isDeeplySleeping(); ++ } ++ // Paper end ++ + @Override + public int getSleepTicks() { + return getHandle().sleepTicks;