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.
This commit is contained in:
JRoy 2020-05-10 23:06:41 -04:00
parent a23aa8c807
commit 5b74f31a52

View file

@ -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.
* <br>