mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Fix pings, add case sensitivity option
This commit is contained in:
1 parent
398b8ce7b4
commit
8270d8e98c
2 files changed
+14
-6
No files matched your search
@@ -26,15 +26,22 @@ public class PingHandler implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getSender().getUUID().equals(event.getTarget().getUUID())) {
|
String targetName = event.getTarget().asOfflinePlayer().getName();
|
||||||
|
String prefix = carbonChat.getConfig().getString("pings.prefix", "");
|
||||||
|
boolean caseSensitive = carbonChat.getConfig().getBoolean("pings.case-sensitive", false);
|
||||||
|
|
||||||
|
if (targetName == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String senderName = event.getSender().asOfflinePlayer().getName();
|
if (caseSensitive) {
|
||||||
String prefix = carbonChat.getConfig().getString("pings.prefix", "");
|
if (!event.getOriginalMessage().contains(prefix + targetName)) {
|
||||||
|
return;
|
||||||
if (senderName == null || !event.getOriginalMessage().contains(prefix + senderName)) {
|
}
|
||||||
return;
|
} else {
|
||||||
|
if (!event.getOriginalMessage().toLowerCase().contains((prefix + targetName).toLowerCase())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Key key = Key.of(carbonChat.getConfig().getString("pings.sound"));
|
Key key = Key.of(carbonChat.getConfig().getString("pings.sound"));
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ nicknames-set-tab-name: true
|
|||||||
# Plays a sound and highlights the message when someone types your name
|
# Plays a sound and highlights the message when someone types your name
|
||||||
pings:
|
pings:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
case-sensitive: false
|
||||||
source: 'PLAYER'
|
source: 'PLAYER'
|
||||||
sound: 'minecraft:entity.experience_orb.pickup'
|
sound: 'minecraft:entity.experience_orb.pickup'
|
||||||
prefix: '@'
|
prefix: '@'
|
||||||
|
|||||||
Reference in new issue
Block a user