geforkt von Mirrors/Paper
#552: Add the ability to retrieve hit, step, fall, and other sounds from blocks.
By: Martoph <sager1018@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
d0bec6507f
Commit
5e82375383
@ -127,6 +127,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
* @see Statistic
|
||||
*/
|
||||
Registry<Statistic> STATISTIC = new SimpleRegistry<>(Statistic.class);
|
||||
/**
|
||||
* Sound keys.
|
||||
*
|
||||
* @see Sound
|
||||
*/
|
||||
Registry<Sound> SOUNDS = new SimpleRegistry<>(Sound.class);
|
||||
/**
|
||||
* Villager profession.
|
||||
*
|
||||
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
70
paper-api/src/main/java/org/bukkit/SoundGroup.java
Normale Datei
70
paper-api/src/main/java/org/bukkit/SoundGroup.java
Normale Datei
@ -0,0 +1,70 @@
|
||||
package org.bukkit;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents a group of sounds for blocks that are played when various actions
|
||||
* happen (ie stepping, breaking, hitting, etc).
|
||||
*/
|
||||
public interface SoundGroup {
|
||||
|
||||
/**
|
||||
* Get the volume these sounds are played at.
|
||||
*
|
||||
* Note that this volume does not always represent the actual volume
|
||||
* received by the client.
|
||||
*
|
||||
* @return volume
|
||||
*/
|
||||
public float getVolume();
|
||||
|
||||
/**
|
||||
* Gets the pitch these sounds are played at.
|
||||
*
|
||||
* Note that this pitch does not always represent the actual pitch received
|
||||
* by the client.
|
||||
*
|
||||
* @return pitch
|
||||
*/
|
||||
public float getPitch();
|
||||
|
||||
/**
|
||||
* Gets the corresponding breaking sound for this group.
|
||||
*
|
||||
* @return the break sound
|
||||
*/
|
||||
@NotNull
|
||||
public Sound getBreakSound();
|
||||
|
||||
/**
|
||||
* Gets the corresponding step sound for this group.
|
||||
*
|
||||
* @return the step sound
|
||||
*/
|
||||
@NotNull
|
||||
public Sound getStepSound();
|
||||
|
||||
/**
|
||||
* Gets the corresponding place sound for this group.
|
||||
*
|
||||
* @return the place sound
|
||||
*/
|
||||
@NotNull
|
||||
public Sound getPlaceSound();
|
||||
|
||||
/**
|
||||
* Gets the corresponding hit sound for this group.
|
||||
*
|
||||
* @return the hit sound
|
||||
*/
|
||||
@NotNull
|
||||
public Sound getHitSound();
|
||||
|
||||
/**
|
||||
* Gets the corresponding fall sound for this group.
|
||||
*
|
||||
* @return the fall sound
|
||||
*/
|
||||
@NotNull
|
||||
public Sound getFallSound();
|
||||
}
|
@ -2,6 +2,7 @@ package org.bukkit.block.data;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.SoundGroup;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -93,4 +94,13 @@ public interface BlockData extends Cloneable {
|
||||
*/
|
||||
@NotNull
|
||||
BlockData clone();
|
||||
|
||||
/**
|
||||
* Gets the block's {@link SoundGroup} which can be used to get its step
|
||||
* sound, hit sound, and others.
|
||||
*
|
||||
* @return the sound effect group
|
||||
*/
|
||||
@NotNull
|
||||
SoundGroup getSoundGroup();
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren