mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Add isDeeplySleeping to HumanEntity (#5470)
This commit is contained in:
parent
bf974a611b
commit
08d5c44532
2 changed files with 50 additions and 0 deletions
26
Spigot-API-Patches/add-isDeeplySleeping-to-HumanEntity.patch
Normal file
26
Spigot-API-Patches/add-isDeeplySleeping-to-HumanEntity.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
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.
|
||||
*
|
|
@ -0,0 +1,24 @@
|
|||
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
|
||||
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;
|
Loading…
Reference in a new issue