diff --git a/sayanvanish-bukkit/src/main/kotlin/org/sayandev/sayanvanish/bukkit/feature/features/FeatureUpdate.kt b/sayanvanish-bukkit/src/main/kotlin/org/sayandev/sayanvanish/bukkit/feature/features/FeatureUpdate.kt index f92a840..cc4dff8 100644 --- a/sayanvanish-bukkit/src/main/kotlin/org/sayandev/sayanvanish/bukkit/feature/features/FeatureUpdate.kt +++ b/sayanvanish-bukkit/src/main/kotlin/org/sayandev/sayanvanish/bukkit/feature/features/FeatureUpdate.kt @@ -14,6 +14,7 @@ import org.sayandev.sayanvanish.bukkit.sayanvanish import org.sayandev.sayanvanish.api.utils.HangarUtils import org.sayandev.sayanvanish.api.utils.VersionInfo import org.sayandev.sayanvanish.bukkit.utils.PlayerUtils.sendComponent +import org.sayandev.sayanvanish.bukkit.utils.PlayerUtils.sendRawComponent import org.sayandev.stickynote.bukkit.log import org.sayandev.stickynote.bukkit.plugin import org.sayandev.stickynote.bukkit.runAsync @@ -33,11 +34,9 @@ class FeatureUpdate( "A new version of SayanVanish is available!", " - Latest release: ", " - Click to download: '>Paper | '>Velocity | '>Waterfall", - " - Changelog: ", " - '>Click to see full changelog", " - Latest snapshot: ", " - Click to download: '>Paper | '>Velocity | '>Waterfall", - " - Changelog: ", " - '>Click to see full changelog" ), val updateRequestContent: List = listOf( @@ -95,7 +94,7 @@ class FeatureUpdate( if (!isNewerVersionAvailable(notifyForSnapshotBuilds) || settings.general.proxyMode) return for (line in updateNotificationContent) { - sender.sendComponent(line + sender.sendRawComponent(line .replace("", latestRelease?.name ?: "Unknown") .replace("", latestRelease?.downloads?.PAPER?.downloadUrl() ?: "https://hangar.papermc.io/Syrent/SayanVanish") .replace("", latestRelease?.downloads?.VELOCITY?.downloadUrl() ?: "https://hangar.papermc.io/Syrent/SayanVanish") diff --git a/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/feature/features/FeatureUpdate.kt b/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/feature/features/FeatureUpdate.kt index 098d8e8..25f45b6 100644 --- a/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/feature/features/FeatureUpdate.kt +++ b/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/feature/features/FeatureUpdate.kt @@ -13,6 +13,7 @@ import org.sayandev.sayanvanish.velocity.api.SayanVanishVelocityAPI.Companion.us import org.sayandev.sayanvanish.velocity.feature.ListenedFeature import org.sayandev.sayanvanish.velocity.sayanvanish import org.sayandev.sayanvanish.velocity.utils.PlayerUtils.sendComponent +import org.sayandev.sayanvanish.velocity.utils.PlayerUtils.sendRawComponent import org.sayandev.stickynote.velocity.StickyNote import org.sayandev.stickynote.velocity.log import org.sayandev.stickynote.velocity.plugin @@ -33,11 +34,9 @@ class FeatureUpdate( "A new version of SayanVanish Velocity is available!", " - Latest release: ", " - Click to download: '>Paper | '>Velocity | '>Waterfall", - " - Changelog: ", " - '>Click to see full changelog", " - Latest snapshot: ", " - Click to download: '>Paper | '>Velocity | '>Waterfall", - " - Changelog: ", " - '>Click to see full changelog" ), val updateRequestContent: List = listOf( @@ -94,7 +93,7 @@ class FeatureUpdate( if (!isNewerVersionAvailable(notifyForSnapshotBuilds)) return for (line in updateNotificationContent) { - sender.sendComponent(line + sender.sendRawComponent(line .replace("", latestRelease?.name ?: "Unknown") .replace("", latestRelease?.downloads?.PAPER?.downloadUrl() ?: "https://hangar.papermc.io/Syrent/SayanVanish") .replace("", latestRelease?.downloads?.VELOCITY?.downloadUrl() ?: "https://hangar.papermc.io/Syrent/SayanVanish") @@ -105,7 +104,6 @@ class FeatureUpdate( .replace("", latestSnapshot?.downloads?.VELOCITY?.downloadUrl() ?: "https://hangar.papermc.io/Syrent/SayanVanish") .replace("", latestSnapshot?.downloads?.WATERFALL?.downloadUrl() ?: "https://hangar.papermc.io/Syrent/SayanVanish") .replace("", shortDescription(latestSnapshot?.description) ?: "Unknown") - .component() ) } } diff --git a/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/utils/PlayerUtils.kt b/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/utils/PlayerUtils.kt index b3d23d6..6e09f82 100644 --- a/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/utils/PlayerUtils.kt +++ b/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/utils/PlayerUtils.kt @@ -28,4 +28,8 @@ object PlayerUtils { content }) } + + fun CommandSource.sendRawComponent(content: String, vararg placeholders: TagResolver) { + this.sendMessage(content.component(*placeholders)) + } } \ No newline at end of file