|
2 | 2 |
|
3 | 3 | import net.pistonmaster.pistonmotd.api.PlaceholderUtil;
|
4 | 4 | import net.pistonmaster.pistonmotd.kyori.PistonSerializersRelocated;
|
5 |
| -import net.pistonmaster.pistonmotd.shadow.kyori.adventure.text.Component; |
6 | 5 | import net.pistonmaster.pistonmotd.shared.extensions.VanishAPIExtension;
|
7 | 6 | import net.pistonmaster.pistonmotd.shared.utils.LuckPermsWrapper;
|
8 | 7 | import net.pistonmaster.pistonmotd.shared.utils.PMHelpers;
|
@@ -79,23 +78,29 @@ default void handle(PistonStatusPing ping) {
|
79 | 78 | if (hideSample && vanished.contains(player.getUniqueId()))
|
80 | 79 | continue;
|
81 | 80 |
|
82 |
| - Component prefix = Component.empty(); |
83 |
| - Component suffix = Component.empty(); |
| 81 | + String prefix = ""; |
| 82 | + String suffix = ""; |
84 | 83 | if (luckperms) {
|
85 | 84 | LuckPermsWrapper.LuckPermsMeta meta = luckpermsWrapper.getWrappedMeta(player);
|
86 | 85 |
|
87 | 86 | if (meta.getPrefix() != null)
|
88 |
| - prefix = PistonSerializersRelocated.ampersandRGB.deserialize(meta.getPrefix()); |
| 87 | + prefix = meta.getPrefix(); |
89 | 88 |
|
90 | 89 | if (meta.getSuffix() != null)
|
91 |
| - suffix = PistonSerializersRelocated.ampersandRGB.deserialize(meta.getSuffix()); |
| 90 | + suffix = meta.getSuffix(); |
92 | 91 | }
|
93 | 92 |
|
94 |
| - String displayName = PistonSerializersRelocated.section.serialize(prefix |
95 |
| - .append(PistonSerializersRelocated.section.deserialize(player.getDisplayName()) |
96 |
| - .append(suffix))) |
97 |
| - // Reset character to prevent color bleeding |
98 |
| - + "§r"; |
| 93 | + String displayName = PistonSerializersRelocated.section.serialize( |
| 94 | + PistonSerializersRelocated.ampersandRGB.deserialize("%s%s%s" |
| 95 | + .formatted( |
| 96 | + prefix, |
| 97 | + PistonSerializersRelocated.ampersandRGB.serialize( |
| 98 | + PistonSerializersRelocated.sectionRGB.deserialize(player.getDisplayName())), |
| 99 | + suffix |
| 100 | + ) |
| 101 | + )) |
| 102 | + // Reset character to prevent color bleeding |
| 103 | + + "§r"; |
99 | 104 |
|
100 | 105 | ping.addSample(player.getUniqueId(), displayName);
|
101 | 106 | }
|
|
0 commit comments