ChatNotifier: don't notify the sender

This commit is contained in:
Erik Bročko 2018-09-06 21:59:26 +02:00
parent 2191b94b9a
commit 938640f203

View File

@ -20,7 +20,7 @@ public class ChatNotifier extends Feature {
e.setCancelled(true);
for (Player p : plugin.getServer().getOnlinePlayers()) {
String msg = e.getMessage();
if (e.getMessage().toLowerCase().contains(p.getName().toLowerCase())) {
if (e.getMessage().toLowerCase().contains(p.getName().toLowerCase()) && p.getPlayer() != e.getPlayer()) {
msg = ChatColor.RED + msg;
// ActionBarAPI.sendActionBar(p, ChatColor.RED + "Byl jsi zminen v chatu", 80);
p.playSound(p.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 3.0F);