summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2012-01-17 22:39:37 +0100
committerErik Broes <erikbroes@grum.nl>2012-01-17 22:43:16 +0100
commit95e3f07b69c85103cdf8fac927add99ff50591d0 (patch)
treecca6b56e03326deedc6cc8c92b011e168aa62a57 /src
parente542942d457647571ca74b99a5aee9ab24d31142 (diff)
downloadbukkit-95e3f07b69c85103cdf8fac927add99ff50591d0.tar
bukkit-95e3f07b69c85103cdf8fac927add99ff50591d0.tar.gz
bukkit-95e3f07b69c85103cdf8fac927add99ff50591d0.tar.lz
bukkit-95e3f07b69c85103cdf8fac927add99ff50591d0.tar.xz
bukkit-95e3f07b69c85103cdf8fac927add99ff50591d0.zip
Add Player.setBedSpawnLocation(Location). Thanks md_5
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/OfflinePlayer.java9
-rw-r--r--src/main/java/org/bukkit/entity/Player.java7
-rw-r--r--src/test/java/org/bukkit/plugin/messaging/TestPlayer.java4
3 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
index a59f8424..013dc0a2 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -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();
+
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 6b35240e..514ef14e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -471,6 +471,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.
*
* @return True if the player is allowed to fly.
diff --git a/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java b/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java
index 119903af..4bef1f02 100644
--- a/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java
+++ b/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java
@@ -605,4 +605,8 @@ public class TestPlayer implements Player {
public void setAllowFlight(boolean flight) {
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ public void setBedSpawnLocation(Location location) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}