From 5b74f31a52739ee4f24624a2c97622cf3b449606 Mon Sep 17 00:00:00 2001 From: JRoy Date: Sun, 10 May 2020 23:06:41 -0400 Subject: [PATCH] Potential bed API Adds a new method to fetch the location of a player's bed without generating any sync loads. getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks. --- .../main/java/org/bukkit/entity/HumanEntity.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java index a7824c9f13..d87261e050 100644 --- a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java @@ -308,6 +308,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int getSleepTicks(); + + // Paper start - Potential bed api + /** + * Gets the Location of the player's bed, null if they have not slept + * in one. This method will not attempt to validate if the current bed + * is still valid. + * + * @return Bed Location if has slept in one, otherwise null. + */ + @Nullable + public Location getPotentialBedLocation(); + // Paper end + /** * Attempts to make the entity sleep at the given location. *