From 916be86fbf99500376e520f87c73659044f79f98 Mon Sep 17 00:00:00 2001 From: Vankka Date: Sat, 29 Jun 2024 15:14:35 +0300 Subject: [PATCH] Fix compile --- .../java/com/discordsrv/bungee/player/BungeePlayer.java | 8 ++++++++ .../game/MinecraftToDiscordChatMessageTest.java | 5 +++++ .../com/discordsrv/velocity/player/VelocityPlayer.java | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/bungee/src/main/java/com/discordsrv/bungee/player/BungeePlayer.java b/bungee/src/main/java/com/discordsrv/bungee/player/BungeePlayer.java index 76c1d8db..a768366a 100644 --- a/bungee/src/main/java/com/discordsrv/bungee/player/BungeePlayer.java +++ b/bungee/src/main/java/com/discordsrv/bungee/player/BungeePlayer.java @@ -26,11 +26,13 @@ import com.discordsrv.common.player.IPlayer; import com.discordsrv.common.player.provider.model.SkinInfo; import net.kyori.adventure.identity.Identity; import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer; import net.md_5.bungee.api.connection.ProxiedPlayer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Locale; +import java.util.concurrent.CompletableFuture; public class BungeePlayer extends BungeeCommandSender implements IPlayer { @@ -53,6 +55,12 @@ public class BungeePlayer extends BungeeCommandSender implements IPlayer { return commandSender.getName(); } + @Override + public CompletableFuture kick(Component component) { + player.disconnect(BungeeComponentSerializer.get().serialize(component)); + return CompletableFuture.completedFuture(null); + } + @Override public @Nullable SkinInfo skinInfo() { return null; diff --git a/common/src/test/java/com/discordsrv/common/messageforwarding/game/MinecraftToDiscordChatMessageTest.java b/common/src/test/java/com/discordsrv/common/messageforwarding/game/MinecraftToDiscordChatMessageTest.java index 91715983..58ce9c40 100644 --- a/common/src/test/java/com/discordsrv/common/messageforwarding/game/MinecraftToDiscordChatMessageTest.java +++ b/common/src/test/java/com/discordsrv/common/messageforwarding/game/MinecraftToDiscordChatMessageTest.java @@ -92,6 +92,11 @@ public class MinecraftToDiscordChatMessageTest { return "Vankka"; } + @Override + public CompletableFuture kick(Component component) { + return null; + } + @Override public @Nullable SkinInfo skinInfo() { return null; diff --git a/velocity/src/main/java/com/discordsrv/velocity/player/VelocityPlayer.java b/velocity/src/main/java/com/discordsrv/velocity/player/VelocityPlayer.java index 3686909c..9325f928 100644 --- a/velocity/src/main/java/com/discordsrv/velocity/player/VelocityPlayer.java +++ b/velocity/src/main/java/com/discordsrv/velocity/player/VelocityPlayer.java @@ -32,6 +32,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Locale; +import java.util.concurrent.CompletableFuture; public class VelocityPlayer extends VelocityCommandSender implements IPlayer { @@ -52,6 +53,12 @@ public class VelocityPlayer extends VelocityCommandSender implements IPlayer { return player.getUsername(); } + @Override + public CompletableFuture kick(Component component) { + player.disconnect(component); + return CompletableFuture.completedFuture(null); + } + @Override public @Nullable SkinInfo skinInfo() { for (GameProfile.Property property : player.getGameProfile().getProperties()) {