Commits

coll1234567 authored and md_5 committed 96340858187
#938: Various Sound API improvements
No tags

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

Modified
384 384 /**
385 385 * Sets the Location where the player will spawn at their bed.
386 386 *
387 387 * @param location where to set the respawn location
388 388 * @param force whether to forcefully set the respawn location even if a
389 389 * valid bed is not present
390 390 */
391 391 public void setBedSpawnLocation(@Nullable Location location, boolean force);
392 392
393 393 /**
394 - * Play a note for a player at a location. This requires a note block
395 - * at the particular location (as far as the client is concerned). This
396 - * will not work without a note block. This will not work with cake.
394 + * Play a note for the player at a location. <br>
395 + * This <i>will</i> work with cake.
397 396 *
398 - * @param loc The location of a note block.
397 + * @param loc The location to play the note
399 398 * @param instrument The instrument ID.
400 399 * @param note The note ID.
401 400 * @deprecated Magic value
402 401 */
403 402 @Deprecated
404 403 public void playNote(@NotNull Location loc, byte instrument, byte note);
405 404
406 405 /**
407 - * Play a note for a player at a location. This requires a note block
408 - * at the particular location (as far as the client is concerned). This
409 - * will not work without a note block. This will not work with cake.
410 - *
411 - * @param loc The location of a note block
406 + * Play a note for the player at a location. <br>
407 + * This <i>will</i> work with cake.
408 + * <p>
409 + * This method will fail silently when called with {@link Instrument#CUSTOM_HEAD}.
410 + * @param loc The location to play the note
412 411 * @param instrument The instrument
413 412 * @param note The note
414 413 */
415 414 public void playNote(@NotNull Location loc, @NotNull Instrument instrument, @NotNull Note note);
416 415
417 416
418 417 /**
419 418 * Play a sound for a player at the location.
420 419 * <p>
421 420 * This function will fail silently if Location or Sound are null.
462 461 * sound for the value passed.
463 462 *
464 463 * @param location The location to play the sound
465 464 * @param sound The internal sound name to play
466 465 * @param category The category of the sound
467 466 * @param volume The volume of the sound
468 467 * @param pitch The pitch of the sound
469 468 */
470 469 public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
471 470
471 + /**
472 + * Play a sound for a player at the location. For sounds with multiple
473 + * variations passing the same seed will always play the same variation.
474 + * <p>
475 + * This function will fail silently if Location or Sound are null.
476 + *
477 + * @param location The location to play the sound
478 + * @param sound The sound to play
479 + * @param category The category of the sound
480 + * @param volume The volume of the sound
481 + * @param pitch The pitch of the sound
482 + * @param seed The seed for the sound
483 + */
484 + public void playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed);
485 +
486 + /**
487 + * Play a sound for a player at the location. For sounds with multiple
488 + * variations passing the same seed will always play the same variation.
489 + * <p>
490 + * This function will fail silently if Location or Sound are null. No sound
491 + * will be heard by the player if their client does not have the respective
492 + * sound for the value passed.
493 + *
494 + * @param location The location to play the sound
495 + * @param sound The internal sound name to play
496 + * @param category The category of the sound
497 + * @param volume The volume of the sound
498 + * @param pitch The pitch of the sound
499 + * @param seed The seed for the sound
500 + */
501 + public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed);
502 +
472 503 /**
473 504 * Play a sound for a player at the location of the entity.
474 505 * <p>
475 506 * This function will fail silently if Entity or Sound are null.
476 507 *
477 508 * @param entity The entity to play the sound
478 509 * @param sound The sound to play
479 510 * @param volume The volume of the sound
480 511 * @param pitch The pitch of the sound
481 512 */
512 543 * This function will fail silently if Entity or Sound are null.
513 544 *
514 545 * @param entity The entity to play the sound
515 546 * @param sound The sound to play
516 547 * @param category The category of the sound
517 548 * @param volume The volume of the sound
518 549 * @param pitch The pitch of the sound
519 550 */
520 551 public void playSound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
521 552
553 + /**
554 + * Play a sound for a player at the location of the entity. For sounds with
555 + * multiple variations passing the same seed will always play the same variation.
556 + * <p>
557 + * This function will fail silently if Entity or Sound are null.
558 + *
559 + * @param entity The entity to play the sound
560 + * @param sound The sound to play
561 + * @param category The category of the sound
562 + * @param volume The volume of the sound
563 + * @param pitch The pitch of the sound
564 + * @param seed The seed for the sound
565 + */
566 + public void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed);
567 +
568 + /**
569 + * Play a sound for a player at the location of the entity. For sounds with
570 + * multiple variations passing the same seed will always play the same variation.
571 + * <p>
572 + * This function will fail silently if Entity or Sound are null.
573 + *
574 + * @param entity The entity to play the sound
575 + * @param sound The sound to play
576 + * @param category The category of the sound
577 + * @param volume The volume of the sound
578 + * @param pitch The pitch of the sound
579 + * @param seed The seed for the sound
580 + */
581 + public void playSound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed);
582 +
522 583 /**
523 584 * Stop the specified sound from playing.
524 585 *
525 586 * @param sound the sound to stop
526 587 */
527 588 public void stopSound(@NotNull Sound sound);
528 589
529 590 /**
530 591 * Stop the specified sound from playing.
531 592 *

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

Add shortcut