Skip to content

Commit 3ab0640

Browse files
committed
don't use deprecated apis
1 parent cb15fe2 commit 3ab0640

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

velocity/src/main/kotlin/net/azisaba/spicyAzisaBan/velocity/VelocityPlayerActor.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import net.kyori.adventure.util.Ticks
1111
import java.net.SocketAddress
1212
import java.util.UUID
1313
import java.util.concurrent.CompletionException
14+
import net.kyori.adventure.text.Component as KComponent
1415
import net.kyori.adventure.title.Title as ATitle
1516

1617
class VelocityPlayerActor(private val player: Player): VelocityActor(player), PlayerActor {
@@ -28,7 +29,7 @@ class VelocityPlayerActor(private val player: Player): VelocityActor(player), Pl
2829
}
2930

3031
override fun disconnect(vararg reason: Component) {
31-
return player.disconnect(TextComponent.ofChildren(*reason.toVelocity()))
32+
return player.disconnect(KComponent.textOfChildren(*reason.toVelocity()))
3233
}
3334

3435
override fun getRemoteAddress(): SocketAddress = player.remoteAddress
@@ -45,9 +46,9 @@ class VelocityPlayerActor(private val player: Player): VelocityActor(player), Pl
4546

4647
override fun sendTitle(title: Title) {
4748
val adventure = ATitle.title(
48-
TextComponent.ofChildren(*title.title.toVelocity()),
49-
TextComponent.ofChildren(*title.subTitle.toVelocity()),
50-
ATitle.Times.of(
49+
KComponent.textOfChildren(*title.title.toVelocity()),
50+
KComponent.textOfChildren(*title.subTitle.toVelocity()),
51+
ATitle.Times.times(
5152
Ticks.duration(title.fadeIn.toLong()),
5253
Ticks.duration(title.stay.toLong()),
5354
Ticks.duration(title.fadeOut.toLong())

0 commit comments

Comments
 (0)