Don't send players a ping sound if they have the player that's pinging them ignored

This commit is contained in:
Teriuihi 2022-11-25 19:49:37 +01:00
parent 57afbbe805
commit 0c1b197054

View File

@ -105,14 +105,16 @@ public class ChatListener implements Listener {
.match(Pattern.compile(name, Pattern.CASE_INSENSITIVE)) .match(Pattern.compile(name, Pattern.CASE_INSENSITIVE))
.replacement(mention.append(onlinePlayer.displayName())) .replacement(mention.append(onlinePlayer.displayName()))
.build()); .build());
playerToPing.add(onlinePlayer); if (!ChatUserManager.getChatUser(onlinePlayer.getUniqueId()).getIgnoredPlayers().contains(player.getUniqueId()))
playerToPing.add(onlinePlayer);
} else if (message.contains(nickName.toLowerCase())) { } else if (message.contains(nickName.toLowerCase())) {
modifiableString.replace(TextReplacementConfig.builder() modifiableString.replace(TextReplacementConfig.builder()
.once() .once()
.match(Pattern.compile(nickName, Pattern.CASE_INSENSITIVE)) .match(Pattern.compile(nickName, Pattern.CASE_INSENSITIVE))
.replacement(mention.append(onlinePlayer.displayName())) .replacement(mention.append(onlinePlayer.displayName()))
.build()); .build());
playerToPing.add(onlinePlayer); if (!ChatUserManager.getChatUser(onlinePlayer.getUniqueId()).getIgnoredPlayers().contains(player.getUniqueId()))
playerToPing.add(onlinePlayer);
} }
} }