mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 02:19:05 +00:00
Added 'None' option to the message sound.
This commit is contained in:
parent
a847a50bbe
commit
bff5797a34
@ -100,6 +100,7 @@ unmuteinterval: 60
|
||||
bungeecordmessaging: false
|
||||
|
||||
# Sound for message notification
|
||||
# Enter 'None' to disable the sound
|
||||
message_sound: ENTITY_PLAYER_LEVELUP
|
||||
|
||||
# This will allow vanished players to be exempt from being sent private messages, and will act as if they aren't online
|
||||
|
@ -100,6 +100,7 @@ unmuteinterval: 60
|
||||
bungeecordmessaging: false
|
||||
|
||||
# Sound for message notification
|
||||
# Enter 'None' to disable the sound
|
||||
message_sound: ENTITY_PLAYER_LEVELUP
|
||||
|
||||
# This will allow vanished players to be exempt from being sent private messages, and will act as if they aren't online
|
||||
|
@ -902,9 +902,12 @@ public class Format {
|
||||
|
||||
public static void playMessageSound(MineverseChatPlayer mcp) {
|
||||
Player player = mcp.getPlayer();
|
||||
Sound messageSound = getSound(getInstance().getConfig().getString("message_sound", DEFAULT_MESSAGE_SOUND));
|
||||
String soundName = getInstance().getConfig().getString("message_sound", DEFAULT_MESSAGE_SOUND);
|
||||
if(!soundName.equalsIgnoreCase("None")) {
|
||||
Sound messageSound = getSound(soundName);
|
||||
player.playSound(player.getLocation(), messageSound, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private static Sound getSound(String soundName) {
|
||||
if(Arrays.asList(Sound.values()).stream().map(Sound::toString).collect(Collectors.toList()).contains(soundName)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user