mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 08:02:13 -07:00
#808: Add custom sound parameter option for playSound with entity as source
By: Gero <gecam59@gmail.com>
This commit is contained in:
@@ -2157,10 +2157,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* sound will be heard by the players if their clients do not have the
|
* sound will be heard by the players if their clients do not have the
|
||||||
* respective sound for the value passed.
|
* respective sound for the value passed.
|
||||||
*
|
*
|
||||||
* @param location the location to play the sound
|
* @param location The location to play the sound
|
||||||
* @param sound the internal sound name to play
|
* @param sound The internal sound name to play
|
||||||
* @param volume the volume of the sound
|
* @param volume The volume of the sound
|
||||||
* @param pitch the pitch of the sound
|
* @param pitch The pitch of the sound
|
||||||
*/
|
*/
|
||||||
void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch);
|
void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch);
|
||||||
|
|
||||||
@@ -2184,11 +2184,11 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* will be heard by the players if their clients do not have the respective
|
* will be heard by the players if their clients do not have the respective
|
||||||
* sound for the value passed.
|
* sound for the value passed.
|
||||||
*
|
*
|
||||||
* @param location the location to play the sound
|
* @param location The location to play the sound
|
||||||
* @param sound the internal sound name to play
|
* @param sound The internal sound name to play
|
||||||
* @param category the category of the sound
|
* @param category The category of the sound
|
||||||
* @param volume the volume of the sound
|
* @param volume The volume of the sound
|
||||||
* @param pitch the pitch of the sound
|
* @param pitch The pitch of the sound
|
||||||
*/
|
*/
|
||||||
void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
|
void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
|
||||||
|
|
||||||
@@ -2211,12 +2211,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
*
|
*
|
||||||
* @param entity The entity to play the sound
|
* @param entity The entity to play the sound
|
||||||
* @param sound The sound to play
|
* @param sound The sound to play
|
||||||
* @param category the category of the sound
|
* @param volume The volume of the sound
|
||||||
|
* @param pitch The pitch of the sound
|
||||||
|
*/
|
||||||
|
void playSound(@NotNull Entity entity, @NotNull String sound, float volume, float pitch);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play a Sound at the location of the provided entity in the World.
|
||||||
|
* <p>
|
||||||
|
* This function will fail silently if Entity or Sound are null.
|
||||||
|
*
|
||||||
|
* @param entity The entity to play the sound
|
||||||
|
* @param sound The sound to play
|
||||||
|
* @param category The category of the sound
|
||||||
* @param volume The volume of the sound
|
* @param volume The volume of the sound
|
||||||
* @param pitch The pitch of the sound
|
* @param pitch The pitch of the sound
|
||||||
*/
|
*/
|
||||||
void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch);
|
void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play a Sound at the location of the provided entity in the World.
|
||||||
|
* <p>
|
||||||
|
* This function will fail silently if Entity or Sound are null.
|
||||||
|
*
|
||||||
|
* @param entity The entity to play the sound
|
||||||
|
* @param sound The sound to play
|
||||||
|
* @param category The category of the sound
|
||||||
|
* @param volume The volume of the sound
|
||||||
|
* @param pitch The pitch of the sound
|
||||||
|
*/
|
||||||
|
void playSound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an array containing the names of all the {@link GameRule}s.
|
* Get an array containing the names of all the {@link GameRule}s.
|
||||||
*
|
*
|
||||||
|
@@ -325,10 +325,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||||||
* sound will be heard by the player if their client does not have the
|
* sound will be heard by the player if their client does not have the
|
||||||
* respective sound for the value passed.
|
* respective sound for the value passed.
|
||||||
*
|
*
|
||||||
* @param location the location to play the sound
|
* @param location The location to play the sound
|
||||||
* @param sound the internal sound name to play
|
* @param sound The internal sound name to play
|
||||||
* @param volume the volume of the sound
|
* @param volume The volume of the sound
|
||||||
* @param pitch the pitch of the sound
|
* @param pitch The pitch of the sound
|
||||||
*/
|
*/
|
||||||
public void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch);
|
public void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch);
|
||||||
|
|
||||||
@@ -352,11 +352,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||||||
* will be heard by the player if their client does not have the respective
|
* will be heard by the player if their client does not have the respective
|
||||||
* sound for the value passed.
|
* sound for the value passed.
|
||||||
*
|
*
|
||||||
* @param location the location to play the sound
|
* @param location The location to play the sound
|
||||||
* @param sound the internal sound name to play
|
* @param sound The internal sound name to play
|
||||||
* @param category The category of the sound
|
* @param category The category of the sound
|
||||||
* @param volume the volume of the sound
|
* @param volume The volume of the sound
|
||||||
* @param pitch the pitch of the sound
|
* @param pitch The pitch of the sound
|
||||||
*/
|
*/
|
||||||
public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
|
public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
|
||||||
|
|
||||||
@@ -372,6 +372,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||||||
*/
|
*/
|
||||||
public void playSound(@NotNull Entity entity, @NotNull Sound sound, float volume, float pitch);
|
public void playSound(@NotNull Entity entity, @NotNull Sound sound, float volume, float pitch);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play a sound for a player at the location of the entity.
|
||||||
|
* <p>
|
||||||
|
* This function will fail silently if Entity or Sound are null.
|
||||||
|
*
|
||||||
|
* @param entity The entity to play the sound
|
||||||
|
* @param sound The sound to play
|
||||||
|
* @param volume The volume of the sound
|
||||||
|
* @param pitch The pitch of the sound
|
||||||
|
*/
|
||||||
|
public void playSound(@NotNull Entity entity, @NotNull String sound, float volume, float pitch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Play a sound for a player at the location of the entity.
|
* Play a sound for a player at the location of the entity.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -385,6 +397,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||||||
*/
|
*/
|
||||||
public void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch);
|
public void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play a sound for a player at the location of the entity.
|
||||||
|
* <p>
|
||||||
|
* This function will fail silently if Entity or Sound are null.
|
||||||
|
*
|
||||||
|
* @param entity The entity to play the sound
|
||||||
|
* @param sound The sound to play
|
||||||
|
* @param category The category of the sound
|
||||||
|
* @param volume The volume of the sound
|
||||||
|
* @param pitch The pitch of the sound
|
||||||
|
*/
|
||||||
|
public void playSound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop the specified sound from playing.
|
* Stop the specified sound from playing.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user