Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2025-01-05 21:01:08 +01:00
Add isDeeplySleeping to HumanEntity (#5470)
Dieser Commit ist enthalten in:
Ursprung
711b7a80bf
Commit
a6d78caae6
26
Spigot-API-Patches/0285-add-isDeeplySleeping-to-HumanEntity.patch
Normale Datei
26
Spigot-API-Patches/0285-add-isDeeplySleeping-to-HumanEntity.patch
Normale Datei
@ -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 f0e0710fef5a3e0b722ece7ccf89c3d0f88f8f0f..2ce774c81a93260a1464183d435b4c418ed61648 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||||
|
@@ -319,6 +319,15 @@ 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.
|
||||||
|
*
|
24
Spigot-Server-Patches/0706-add-isDeeplySleeping-to-HumanEntity.patch
Normale Datei
24
Spigot-Server-Patches/0706-add-isDeeplySleeping-to-HumanEntity.patch
Normale Datei
@ -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 b99423b3b413fc6364c6530a99e3c74dd406e1b4..f2b2db663198037ba4b7942815bfcd5ddd0e2a8d 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||||
|
@@ -123,6 +123,13 @@ 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;
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren