Fix compile

This commit is contained in:
Vankka 2024-06-29 15:14:35 +03:00
parent f285669990
commit 916be86fbf
No known key found for this signature in database
GPG Key ID: 62E48025ED4E7EBB
3 changed files with 20 additions and 0 deletions

View File

@ -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<Void> kick(Component component) {
player.disconnect(BungeeComponentSerializer.get().serialize(component));
return CompletableFuture.completedFuture(null);
}
@Override
public @Nullable SkinInfo skinInfo() {
return null;

View File

@ -92,6 +92,11 @@ public class MinecraftToDiscordChatMessageTest {
return "Vankka";
}
@Override
public CompletableFuture<Void> kick(Component component) {
return null;
}
@Override
public @Nullable SkinInfo skinInfo() {
return null;

View File

@ -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<Void> kick(Component component) {
player.disconnect(component);
return CompletableFuture.completedFuture(null);
}
@Override
public @Nullable SkinInfo skinInfo() {
for (GameProfile.Property property : player.getGameProfile().getProperties()) {