Commits

Nothixal authored and md_5 committed 1d5228782e1
#966: Introduce getRespawnLocation as a replacement for getBedSpawnLocation
No tags

src/main/java/org/bukkit/entity/Player.java

Modified
363 363 *
364 364 * @return Whether player is ignoring sleep.
365 365 */
366 366 public boolean isSleepingIgnored();
367 367
368 368 /**
369 369 * Gets the Location where the player will spawn at their bed, null if
370 370 * they have not slept in one or their current bed spawn is invalid.
371 371 *
372 372 * @return Bed Spawn Location if bed exists, otherwise null.
373 + *
374 + * @see #getRespawnLocation()
375 + * @deprecated Misleading name. This method also returns the location of
376 + * respawn anchors.
373 377 */
374 378 @Nullable
375 379 @Override
380 + @Deprecated
376 381 public Location getBedSpawnLocation();
377 382
383 + /**
384 + * Gets the Location where the player will spawn at, null if they
385 + * don't have a valid respawn point.
386 + *
387 + * @return respawn location if exists, otherwise null.
388 + */
389 + @Nullable
390 + @Override
391 + public Location getRespawnLocation();
392 +
378 393 /**
379 394 * Sets the Location where the player will spawn at their bed.
380 395 *
381 396 * @param location where to set the respawn location
397 + *
398 + * @see #setRespawnLocation(Location)
399 + * @deprecated Misleading name. This method sets the player's respawn
400 + * location more generally and is not limited to beds.
382 401 */
402 + @Deprecated
383 403 public void setBedSpawnLocation(@Nullable Location location);
384 404
405 + /**
406 + * Sets the Location where the player will respawn.
407 + *
408 + * @param location where to set the respawn location
409 + */
410 + public void setRespawnLocation(@Nullable Location location);
411 +
385 412 /**
386 413 * Sets the Location where the player will spawn at their bed.
387 414 *
388 415 * @param location where to set the respawn location
389 416 * @param force whether to forcefully set the respawn location even if a
390 417 * valid bed is not present
418 + *
419 + * @see #setRespawnLocation(Location, boolean)
420 + * @deprecated Misleading name. This method sets the player's respawn
421 + * location more generally and is not limited to beds.
391 422 */
423 + @Deprecated
392 424 public void setBedSpawnLocation(@Nullable Location location, boolean force);
393 425
426 + /**
427 + * Sets the Location where the player will respawn.
428 + *
429 + * @param location where to set the respawn location
430 + * @param force whether to forcefully set the respawn location even if a
431 + * valid respawn point is not present
432 + */
433 + public void setRespawnLocation(@Nullable Location location, boolean force);
434 +
394 435 /**
395 436 * Play a note for the player at a location. <br>
396 437 * This <i>will</i> work with cake.
397 438 *
398 439 * @param loc The location to play the note
399 440 * @param instrument The instrument ID.
400 441 * @param note The note ID.
401 442 * @deprecated Magic value
402 443 */
403 444 @Deprecated

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut