|
8 | 8 |
|
9 | 9 | import net.milkbowl.vault.chat.Chat;
|
10 | 10 | import xyz.olivermartin.multichat.bungee.MultiChatUtil;
|
| 11 | +import xyz.olivermartin.multichat.local.common.LocalConsoleLogger; |
11 | 12 | import xyz.olivermartin.multichat.local.common.LocalMetaManager;
|
12 | 13 | import xyz.olivermartin.multichat.local.common.MultiChatLocal;
|
13 | 14 | import xyz.olivermartin.multichat.local.spigot.hooks.LocalSpigotVaultHook;
|
@@ -72,22 +73,40 @@ public String getWorld(UUID uuid) {
|
72 | 73 | @Override
|
73 | 74 | public String getDisplayName(UUID uuid) {
|
74 | 75 |
|
| 76 | + LocalConsoleLogger logger = MultiChatLocal.getInstance().getConsoleLogger(); |
| 77 | + |
75 | 78 | Player player = Bukkit.getPlayer(uuid);
|
76 | 79 |
|
77 | 80 | if (player == null) return "";
|
78 | 81 |
|
79 | 82 | // If MultiChat is setting the display name...
|
80 | 83 | if (MultiChatLocal.getInstance().getDataStore().isSetDisplayName()) {
|
81 | 84 |
|
| 85 | + logger.debug("[LocalSpigotMetaManager] We are setting the display name!"); |
| 86 | + |
82 | 87 | String displayNameFormat = MultiChatLocal.getInstance().getDataStore().getDisplayNameFormatLastVal();
|
83 | 88 |
|
| 89 | + logger.debug("[LocalSpigotMetaManager] Format = " + displayNameFormat); |
| 90 | + logger.debug("[LocalSpigotMetaManager] Format (using & only) = " + displayNameFormat.replaceAll("(?i)§(?=[a-f,0-9,k-o,r,x])", "&")); |
| 91 | + |
84 | 92 | // TODO This stuff could be refactored as it is duplicated between Spigot and Sponge
|
85 | 93 | displayNameFormat = displayNameFormat.replaceAll("%NICK%", getNick(uuid));
|
86 | 94 | displayNameFormat = displayNameFormat.replaceAll("%NAME%", player.getName());
|
87 | 95 | displayNameFormat = displayNameFormat.replaceAll("%PREFIX%", getPrefix(uuid));
|
88 | 96 | displayNameFormat = displayNameFormat.replaceAll("%SUFFIX%", getSuffix(uuid));
|
| 97 | + |
| 98 | + logger.debug("[LocalSpigotMetaManager] Format with placeholders = " + displayNameFormat); |
| 99 | + logger.debug("[LocalSpigotMetaManager] Format with placeholders (using & only) = " + displayNameFormat.replaceAll("(?i)§(?=[a-f,0-9,k-o,r,x])", "&")); |
| 100 | + |
89 | 101 | displayNameFormat = MultiChatUtil.reformatRGB(displayNameFormat);
|
90 |
| - displayNameFormat = displayNameFormat.replaceAll("&(?=[a-f,0-9,k-o,r,x])", "§"); |
| 102 | + |
| 103 | + logger.debug("[LocalSpigotMetaManager] Format after reformatting RGB = " + displayNameFormat); |
| 104 | + logger.debug("[LocalSpigotMetaManager] Format after reformatting RGB (using & only) = " + displayNameFormat.replaceAll("(?i)§(?=[a-f,0-9,k-o,r,x])", "&")); |
| 105 | + |
| 106 | + displayNameFormat = displayNameFormat.replaceAll("(?i)&(?=[a-f,0-9,k-o,r,x])", "§"); |
| 107 | + |
| 108 | + logger.debug("[LocalSpigotMetaManager] FINAL = " + displayNameFormat); |
| 109 | + logger.debug("[LocalSpigotMetaManager] FINAL (using & only) = " + displayNameFormat.replaceAll("(?i)§(?=[a-f,0-9,k-o,r,x])", "&")); |
91 | 110 |
|
92 | 111 | // LEGACY HACK
|
93 | 112 | if (MultiChatLocal.getInstance().getDataStore().isLegacy()) {
|
|
0 commit comments