13
0
geforkt von Mirrors/Paper

Fix contract with Player.getBedSpawnLocation. Fixes BUKKIT-3525

Getting the bed spawn location is supposed to check if the bed is
valid, however, it currently did not do so.
Dieser Commit ist enthalten in:
feildmaster 2013-01-29 10:03:05 -06:00
Ursprung 0576395ddd
Commit 37975946a2

Datei anzeigen

@ -608,8 +608,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public Location getBedSpawnLocation() {
World world = getServer().getWorld(getHandle().spawnWorld);
if ((world != null) && (getHandle().getBed() != null)) {
return new Location(world, getHandle().getBed().x, getHandle().getBed().y, getHandle().getBed().z);
ChunkCoordinates bed = getHandle().getBed();
if (world != null) {
bed = EntityHuman.getBed(((CraftWorld) world).getHandle(), bed, getHandle().isRespawnForced());
if (bed != null) {
return new Location(world, bed.x, bed.y, bed.z);
}
}
return null;
}