3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 13:00:06 +01:00

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() { public Location getBedSpawnLocation() {
World world = getServer().getWorld(getHandle().spawnWorld); World world = getServer().getWorld(getHandle().spawnWorld);
if ((world != null) && (getHandle().getBed() != null)) { ChunkCoordinates bed = getHandle().getBed();
return new Location(world, getHandle().getBed().x, getHandle().getBed().y, getHandle().getBed().z);
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; return null;
} }