Added getBedSpawnLocation to CraftPlayer. Thanks fernferret!

This commit is contained in:
EvilSeph 2011-09-20 23:36:17 -04:00
parent 3f04f04be6
commit 905b977670

View File

@ -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;
}
}
}