mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Changed sound playing to effect dispatching, since these seem more like more like encompassing effect than mere sounds.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
db11d49745
commit
e471f45bae
3 changed files with 40 additions and 37 deletions
25
paper-api/src/main/java/org/bukkit/Effect.java
Normal file
25
paper-api/src/main/java/org/bukkit/Effect.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package org.bukkit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of effects that the server is able to send to players.
|
||||||
|
*/
|
||||||
|
public enum Effect {
|
||||||
|
BOW_FIRE(1002),
|
||||||
|
CLICK1(1001),
|
||||||
|
CLICK2(1000),
|
||||||
|
DOOR_TOGGLE(1003),
|
||||||
|
EXTINGUISH(1004),
|
||||||
|
RECORD_PLAY(1005),
|
||||||
|
SMOKE(2000),
|
||||||
|
STEP_SOUND(2001);
|
||||||
|
|
||||||
|
private final int id;
|
||||||
|
|
||||||
|
Effect(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,25 +0,0 @@
|
||||||
package org.bukkit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of sounds that the server is able to send to players.
|
|
||||||
*/
|
|
||||||
public enum Sound {
|
|
||||||
BOW_FIRE(1002),
|
|
||||||
CLICK1(1001),
|
|
||||||
CLICK2(1000),
|
|
||||||
DOOR_SOUND(1003),
|
|
||||||
EXTINGUISH(1004),
|
|
||||||
RECORD_PLAY(1005),
|
|
||||||
SMOKE(2000),
|
|
||||||
STEP_SOUND(2001);
|
|
||||||
private final int soundIdentifier;
|
|
||||||
|
|
||||||
Sound(int soundIdentifier) {
|
|
||||||
this.soundIdentifier = soundIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSoundIdentifier() {
|
|
||||||
return this.soundIdentifier;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -533,29 +533,32 @@ public interface World {
|
||||||
public List<BlockPopulator> getPopulators();
|
public List<BlockPopulator> getPopulators();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays a sound to just one player.
|
* Plays an effect to just one player.
|
||||||
* @param player the player to play the sound for
|
*
|
||||||
* @param sound the {@link Sound}
|
* @param player the player to play the effect for
|
||||||
|
* @param effect the {@link Effect}
|
||||||
* @param data a data bit needed for the RECORD_PLAY, SMOKE, and STEP_SOUND sounds
|
* @param data a data bit needed for the RECORD_PLAY, SMOKE, and STEP_SOUND sounds
|
||||||
*/
|
*/
|
||||||
public void playSound(Player player, Sound sound, int data);
|
public void playEffect(Player player, Effect effect, int data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays a sound to all players within a default radius around a given location.
|
* Plays an effect to all players within a default radius around a given location.
|
||||||
|
*
|
||||||
* @param location the {@link Location} around which players must be to hear the sound
|
* @param location the {@link Location} around which players must be to hear the sound
|
||||||
* @param sound the {@link Sound}
|
* @param effect the {@link Effect}
|
||||||
* @param data a data bit needed for the RECORD_PLAY, SMOKE, and STEP_SOUND sounds
|
* @param data a data bit needed for the RECORD_PLAY, SMOKE, and STEP_SOUND sounds
|
||||||
*/
|
*/
|
||||||
public void playSound(Location location, Sound sound, int data);
|
public void playEffect(Location location, Effect effect, int data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays a sound to all players within a given radius around a location.
|
* Plays an effect to all players within a given radius around a location.
|
||||||
* @param location the {@link Location} around which players must be to hear the sound
|
*
|
||||||
* @param sound the {@link Sound}
|
* @param location the {@link Location} around which players must be to hear the effect
|
||||||
* @param data a data bit needed for the RECORD_PLAY, SMOKE, and STEP_SOUND sounds
|
* @param effect the {@link Effect}
|
||||||
|
* @param data a data bit needed for the RECORD_PLAY, SMOKE, and STEP effects
|
||||||
* @param radius the radius around the location
|
* @param radius the radius around the location
|
||||||
*/
|
*/
|
||||||
public void playSound(Location location, Sound sound, int data, int radius);
|
public void playEffect(Location location, Effect effect, int data, int radius);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents various map environment types that a world may be
|
* Represents various map environment types that a world may be
|
||||||
|
|
Loading…
Reference in a new issue