Skip to content

Commit

Permalink
Rename getPotentialBedLocation to getPotentialRespawnLocation (PaperM…
Browse files Browse the repository at this point in the history
  • Loading branch information
masmc05 authored Jan 12, 2025
1 parent ed75b0e commit 08ac057
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion paper-api/src/main/java/org/bukkit/entity/HumanEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,25 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
* is still valid.
*
* @return Bed Location if has slept in one, otherwise null.
* @see #getPotentialRespawnLocation()
* @deprecated Misleading name. This method also returns the location of
* respawn anchors.
*/
@Nullable
public Location getPotentialBedLocation();
@Deprecated(since = "1.21.4")
default Location getPotentialBedLocation() {
return this.getPotentialRespawnLocation();
}

/**
* Gets the Location where the player will spawn at, null if they
* don't have a valid respawn point. This method will not attempt
* to validate if the current respawn location is still valid.
*
* @return respawn location if exists, otherwise null.
*/
@Nullable
Location getPotentialRespawnLocation();
// Paper end
// Paper start
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public int getSleepTicks() {

// Paper start - Potential bed api
@Override
public Location getPotentialBedLocation() {
public Location getPotentialRespawnLocation() {
ServerPlayer handle = (ServerPlayer) getHandle();
BlockPos bed = handle.getRespawnPosition();
if (bed == null) {
Expand Down

0 comments on commit 08ac057

Please sign in to comment.