Skip to content

Commit

Permalink
Add Player.setBedSpawnLocation(Location). Thanks md_5
Browse files Browse the repository at this point in the history
  • Loading branch information
grum committed Jan 17, 2012
1 parent 0062c83 commit a210df5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/org/bukkit/OfflinePlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,13 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* @return True if the player has played before, otherwise false
*/
public boolean hasPlayedBefore();

/**
* Gets the Location where the player will spawn at their bed, null if they
* have not slept in one or their current bed spawn is invalid.
*
* @return Bed Spawn Location if bed exists, otherwise null.
*/
public Location getBedSpawnLocation();

}
7 changes: 7 additions & 0 deletions src/main/java/org/bukkit/entity/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,13 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
*/
public Location getBedSpawnLocation();

/**
* Sets the Location where the player will spawn at their bed.
*
* @param location where to set the respawn location
*/
public void setBedSpawnLocation(Location location);

/**
* Determines if the Player is allowed to fly via jump key double-tap like in creative mode.
*
Expand Down
4 changes: 4 additions & 0 deletions src/test/java/org/bukkit/plugin/messaging/TestPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -605,4 +605,8 @@ public boolean getAllowFlight() {
public void setAllowFlight(boolean flight) {
throw new UnsupportedOperationException("Not supported yet.");
}

public void setBedSpawnLocation(Location location) {
throw new UnsupportedOperationException("Not supported yet.");
}
}

0 comments on commit a210df5

Please sign in to comment.