public enum SoundType extends java.lang.Enum<SoundType>
定义了不同类别的声音类型,用于声音播放时的分类管理
对应Minecraft客户端设置中的音量滑块分类,玩家可以单独调节每种类型的音量
用于 GermPacketAPI.playSound(org.bukkit.entity.Player, java.lang.String)
等声音播放相关的方法
Enum Constant and Description |
---|
AMBIENT
环境
环境音效和氛围声音
|
BLOCKS
方块
方块放置、破坏等相关的声音
|
HOSTILE
敌对生物
怪物和敌对生物发出的声音
|
MASTER
主音量
控制所有声音的总音量
|
MUSIC
音乐
背景音乐和唱片音乐
|
NEUTRAL
友好生物
动物和友好生物发出的声音
|
PLAYER
玩家
玩家相关的声音,如脚步声、受伤声等
|
RECORDS
唱片
唱片机播放的音乐
|
VOICE
语音
语音聊天相关的声音
|
WEATHER
天气
雨声、雷声等天气相关的声音
|
Modifier and Type | Method and Description |
---|---|
static SoundType |
getSoundTypeFromType(java.lang.String type)
根据字符串类型获取声音类型
字符串不区分大小写
|
static SoundType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static SoundType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SoundType MASTER
控制所有声音的总音量
public static final SoundType MUSIC
背景音乐和唱片音乐
public static final SoundType RECORDS
唱片机播放的音乐
public static final SoundType WEATHER
雨声、雷声等天气相关的声音
public static final SoundType BLOCKS
方块放置、破坏等相关的声音
public static final SoundType HOSTILE
怪物和敌对生物发出的声音
public static final SoundType NEUTRAL
动物和友好生物发出的声音
public static final SoundType PLAYER
玩家相关的声音,如脚步声、受伤声等
public static final SoundType AMBIENT
环境音效和氛围声音
public static final SoundType VOICE
语音聊天相关的声音
public static SoundType[] values()
for (SoundType c : SoundType.values()) System.out.println(c);
public static SoundType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static SoundType getSoundTypeFromType(java.lang.String type)
字符串不区分大小写
type
- 声音类型字符串java.lang.NullPointerException
- 如果找不到对应的声音类型