From 0a91264bcc8bdb5d488897f6a3e10fa3ff0128c5 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 15 Jul 2011 20:35:09 +0200 Subject: Moved user.setDisplayName() from EssentialsChat to Essentials Added new config: change-displayname (default to true) It allows users to disable the setDisplayName, if they have other plugins that modify the display name Updated user.getNick() to use StringBuilder --- .../earth2me/essentials/chat/EssentialsChatPlayerListener.java | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'EssentialsChat/src/com') diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java index 57c41de72..466641e32 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java @@ -35,15 +35,6 @@ public class EssentialsChatPlayerListener extends PlayerListener public void onPlayerJoin(final PlayerJoinEvent event) { final User user = ess.getUser(event.getPlayer()); - updateDisplayName(user); - } - - private void updateDisplayName(final User user) - { - final String prefix = ess.getPermissionsHandler().getPrefix(user).replace('&', '§').replace("{WORLDNAME}", user.getWorld().getName()); - final String suffix = ess.getPermissionsHandler().getSuffix(user).replace('&', '§').replace("{WORLDNAME}", user.getWorld().getName()); - - user.setDisplayName(prefix + user.getNick() + suffix + (suffix.length() > 1 && suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§") ? "" : "§f")); } @Override @@ -58,7 +49,6 @@ public class EssentialsChatPlayerListener extends PlayerListener return; final User user = ess.getUser(event.getPlayer()); - updateDisplayName(user); if (user.isAuthorized("essentials.chat.color")) { -- cgit v1.2.3