diff --git a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java index 1def623ad3..ff59479f47 100644 --- a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java +++ b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java @@ -171,10 +171,24 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * they have not slept in one or their current bed spawn is invalid. * * @return Bed Spawn Location if bed exists, otherwise null. + * + * @see #getRespawnLocation() + * @deprecated Misleading name. This method also returns the location of + * respawn anchors. */ @Nullable + @Deprecated public Location getBedSpawnLocation(); + /** + * Gets the Location where the player will spawn at, null if they + * don't have a valid respawn point. + * + * @return respawn location if exists, otherwise null. + */ + @Nullable + public Location getRespawnLocation(); + /** * Increments the given statistic for this player. *

diff --git a/paper-api/src/main/java/org/bukkit/entity/Player.java b/paper-api/src/main/java/org/bukkit/entity/Player.java index 246acd6e98..be7965161b 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Player.java +++ b/paper-api/src/main/java/org/bukkit/entity/Player.java @@ -370,27 +370,68 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * they have not slept in one or their current bed spawn is invalid. * * @return Bed Spawn Location if bed exists, otherwise null. + * + * @see #getRespawnLocation() + * @deprecated Misleading name. This method also returns the location of + * respawn anchors. */ @Nullable @Override + @Deprecated public Location getBedSpawnLocation(); + /** + * Gets the Location where the player will spawn at, null if they + * don't have a valid respawn point. + * + * @return respawn location if exists, otherwise null. + */ + @Nullable + @Override + public Location getRespawnLocation(); + /** * Sets the Location where the player will spawn at their bed. * * @param location where to set the respawn location + * + * @see #setRespawnLocation(Location) + * @deprecated Misleading name. This method sets the player's respawn + * location more generally and is not limited to beds. */ + @Deprecated public void setBedSpawnLocation(@Nullable Location location); + /** + * Sets the Location where the player will respawn. + * + * @param location where to set the respawn location + */ + public void setRespawnLocation(@Nullable Location location); + /** * Sets the Location where the player will spawn at their bed. * * @param location where to set the respawn location * @param force whether to forcefully set the respawn location even if a * valid bed is not present + * + * @see #setRespawnLocation(Location, boolean) + * @deprecated Misleading name. This method sets the player's respawn + * location more generally and is not limited to beds. */ + @Deprecated public void setBedSpawnLocation(@Nullable Location location, boolean force); + /** + * Sets the Location where the player will respawn. + * + * @param location where to set the respawn location + * @param force whether to forcefully set the respawn location even if a + * valid respawn point is not present + */ + public void setRespawnLocation(@Nullable Location location, boolean force); + /** * Play a note for the player at a location.
* This will work with cake.