summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0f9d418e..e38ec9b0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -22,6 +22,7 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Note;
import org.bukkit.Statistic;
+import org.bukkit.World;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.map.CraftMapView;
@@ -483,4 +484,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setFoodLevel(int value) {
getHandle().getFoodData().foodLevel = value;
}
+
+ public Location getBedSpawnLocation() {
+ World world = getServer().getWorld(getHandle().spawnWorld);
+ if (world != null) {
+ return new Location(world, getHandle().getBed().x, getHandle().getBed().y, getHandle().getBed().z);
+ } else {
+ return null;
+ }
+ }
}