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:
Ursprung
0576395ddd
Commit
37975946a2
@ -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;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren