Added 'None' option to the message sound.

This commit is contained in:
Aust1n46 2021-07-01 20:23:33 -04:00
parent a847a50bbe
commit bff5797a34
3 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -902,8 +902,11 @@ public class Format {
public static void playMessageSound(MineverseChatPlayer mcp) {
Player player = mcp.getPlayer();
Sound messageSound = getSound(getInstance().getConfig().getString("message_sound", DEFAULT_MESSAGE_SOUND));
player.playSound(player.getLocation(), messageSound, 1, 0);
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) {