diff --git a/CHANGELOG.md b/CHANGELOG.md index 5064897..053d972 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,4 @@ NotAlexNoyle 05/04/26: - Migrate vanish detection from the Essentials API to the Vanish-OG API surface. - Append ` &7> ` separator in chat formatting so the trailing `>` can be removed from LuckPerms suffixes. +- Fix Unions-OG prefix support. diff --git a/src/main/kotlin/nl/skbotnl/chatog/Events.kt b/src/main/kotlin/nl/skbotnl/chatog/Events.kt index 596cc3d..9136ab4 100755 --- a/src/main/kotlin/nl/skbotnl/chatog/Events.kt +++ b/src/main/kotlin/nl/skbotnl/chatog/Events.kt @@ -191,8 +191,9 @@ internal class Events : Listener { var nameString = "${PlayerAffix.getPrefix(event.player.uniqueId)}${event.player.name}" - if (PlaceholderAPI.setPlaceholders(event.player, "%simpleclans_union_color_tag%") != "") { - nameString = PlaceholderAPI.setPlaceholders(event.player, "&8[%simpleclans_union_color_tag%&8] $nameString") + val unionColorTag = PlaceholderAPI.setPlaceholders(event.player, "%simpleclans_union_color_tag%") + if (unionColorTag.isNotEmpty() && unionColorTag != "None") { + nameString = "&8[$unionColorTag&8] $nameString" } val nameComponent = UtilitiesOG.trueogColorize(legacyToMm(nameString)) diff --git a/src/main/kotlin/nl/skbotnl/chatog/translation/command/TranslateMessage.kt b/src/main/kotlin/nl/skbotnl/chatog/translation/command/TranslateMessage.kt index 72d38cd..a0cfe3f 100755 --- a/src/main/kotlin/nl/skbotnl/chatog/translation/command/TranslateMessage.kt +++ b/src/main/kotlin/nl/skbotnl/chatog/translation/command/TranslateMessage.kt @@ -142,12 +142,9 @@ internal class TranslateMessage : CommandExecutor { "${PlayerAffix.getPrefix(sentChatMessage.player.uniqueId)}${sentChatMessage.player.name} ${ PlayerAffix.getSuffix(sentChatMessage.player.uniqueId) }" - if (PlaceholderAPI.setPlaceholders(sentMessage.player, "%simpleclans_clan_color_tag%") != "") { - playerString = - PlaceholderAPI.setPlaceholders( - sentMessage.player, - "&8[%simpleclans_clan_color_tag%&8] $playerString", - ) + val clanColorTag = PlaceholderAPI.setPlaceholders(sentMessage.player, "%simpleclans_clan_color_tag%") + if (clanColorTag.isNotEmpty() && clanColorTag != "None") { + playerString = "&8[$clanColorTag&8] $playerString" } val playerComponent = UtilitiesOG.trueogColorize( diff --git a/src/main/kotlin/nl/skbotnl/chatog/util/ChatUtil.kt b/src/main/kotlin/nl/skbotnl/chatog/util/ChatUtil.kt index fc1e70a..401eac1 100644 --- a/src/main/kotlin/nl/skbotnl/chatog/util/ChatUtil.kt +++ b/src/main/kotlin/nl/skbotnl/chatog/util/ChatUtil.kt @@ -29,8 +29,9 @@ internal object ChatUtil { fun getPlayerPartString(player: Player): String { var playerPart = "${PlayerAffix.getPrefix(player.uniqueId)}${player.name}" - if (PlaceholderAPI.setPlaceholders(player, "%simpleclans_clan_color_tag%") != "") { - playerPart = PlaceholderAPI.setPlaceholders(player, "&8[%simpleclans_clan_color_tag%&8] $playerPart") + val clanColorTag = PlaceholderAPI.setPlaceholders(player, "%simpleclans_clan_color_tag%") + if (clanColorTag.isNotEmpty() && clanColorTag != "None") { + playerPart = "&8[$clanColorTag&8] $playerPart" } return playerPart