Skip to content

Commit

Permalink
Stop spamming the logs
Browse files Browse the repository at this point in the history
No need to spam the logs on success.
  • Loading branch information
Binero authored Apr 11, 2022
1 parent 903ed04 commit 423d659
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/main/java/net/chatsounds/mixin/ChatsoundsMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,32 @@ private void addMessage(Text message, int messageId, int timestamp, boolean refr

if (message instanceof TranslatableText) {
String key = ((TranslatableText)message).getKey();
System.out.println(String.format("Translation key: %s", key));

if (config.join.enabled && key.contains("multiplayer.player.joined")) {
System.out.println(String.format("Chatsounds playing join sound."));
client.getSoundManager().play(config.join.getChatSound(x, y, z));

} else if (config.leave.enabled && key.contains("multiplayer.player.left")) {
System.out.println(String.format("Chatsounds playing leave sound."));
client.getSoundManager().play(config.leave.getChatSound(x, y, z));

} else if (config.death.enabled && key.contains("death.")) {
System.out.println(String.format("Chatsounds playing death sound."));
client.getSoundManager().play(config.death.getChatSound(x, y, z));

} else if (config.pm.enabled && key.contains("commands.message.display.")) {
System.out.println(String.format("Chatsounds playing pm sound."));
client.getSoundManager().play(config.pm.getChatSound(x, y, z));

} else if (config.advancement.enabled && key.contains("chat.type.advancement.")) {
System.out.println(String.format("Chatsounds playing advancement sound."));
client.getSoundManager().play(config.advancement.getChatSound(x, y, z));

} else if (config.message.enabled && key.contains("chat.type.")) {
System.out.println(String.format("Chatsounds playing message sound."));
client.getSoundManager().play(config.message.getChatSound(x, y, z));

} else {
System.out.println(String.format("Chatsounds failed to recognize translation key: %s", key));
System.out.println(String.format("Chatsounds failed to find translation key: %s", key));
client.getSoundManager().play(config.message.getChatSound(x, y, z));
}

} else {
System.out.println("Chatsounds failed to find translation key.");
// Fall back to the message sound
if (config.message.enabled) client.getSoundManager().play(config.message.getChatSound(x, y, z));
}
}
Expand Down

0 comments on commit 423d659

Please sign in to comment.