Source:
<code>public void onPlayerChat(final AsyncPlayerChatEvent event) { if (isAborted(event)) { return; } final User user = ess.getUser(event.getPlayer()); if (user == null) { event.setCancelled(true); return; } final ChatStore chatStore = new ChatStore(ess, user, getChatType(event.getMessage())); setChatStore(event, chatStore); <START> String formatted = FormatUtil.formatMessage(user, "essentials.chat", event.getMessage()); if ((ChatColor.stripColor(formatted)).length() == 0) { event.setCancelled(true); } event.setMessage(formatted); <END> String group = user.getGroup(); String world = user.getWorld().getName(); Player player = user.getBase(); String prefix = FormatUtil.replaceFormat(ess.getPermissionsHandler().getPrefix(player)); String suffix = FormatUtil.replaceFormat(ess.getPermissionsHandler().getSuffix(player)); Team team = player.getScoreboard().getPlayerTeam(player); String format = ess.getSettings().getChatFormat(group); format = format.replace("{0}", group); format = format.replace("{1}", world); format = format.replace("{2}", world.substring(0, 1).toUpperCase(Locale.ENGLISH)); format = format.replace("{3}", team == null ? "" : team.getPrefix()); format = format.replace("{4}", team == null ? "" : team.getSuffix()); format = format.replace("{5}", team == null ? "" : team.getDisplayName()); format = format.replace("{6}", prefix); format = format.replace("{7}", suffix); format = format.replace("{8}", player.getName()); synchronized (format) { event.setFormat(format); } }</code><technical_language>suggestion event.setMessage(FormatUtil.formatMessage(user, "essentials.chat", event.getMessage())); if ((ChatColor.stripColor(event.getMessage())).length() == 0) { event.setCancelled(true); return; }</technical_language>

Target:
public void onPlayerChat(final AsyncPlayerChatEvent event) { if (isAborted(event)) { return; } final User user = ess.getUser(event.getPlayer()); if (user == null) { event.setCancelled(true); return; } final ChatStore chatStore = new ChatStore(ess, user, getChatType(event.getMessage())); setChatStore(event, chatStore); event.setMessage(FormatUtil.formatMessage(user, "essentials.chat", event.getMessage())); if ((ChatColor.stripColor(event.getMessage())).length() == 0) { event.setCancelled(true); return; } String group = user.getGroup(); String world = user.getWorld().getName(); Player player = user.getBase(); String prefix = FormatUtil.replaceFormat(ess.getPermissionsHandler().getPrefix(player)); String suffix = FormatUtil.replaceFormat(ess.getPermissionsHandler().getSuffix(player)); Team team = player.getScoreboard().getPlayerTeam(player); String format = ess.getSettings().getChatFormat(group); format = format.replace("{0}", group); format = format.replace("{1}", world); format = format.replace("{2}", world.substring(0, 1).toUpperCase(Locale.ENGLISH)); format = format.replace("{3}", team == null ? "" : team.getPrefix()); format = format.replace("{4}", team == null ? "" : team.getSuffix()); format = format.replace("{5}", team == null ? "" : team.getDisplayName()); format = format.replace("{6}", prefix); format = format.replace("{7}", suffix); format = format.replace("{8}", player.getName()); synchronized (format) { event.setFormat(format); } }