diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/ServerCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/ServerCommand.java index fe7bb5b55..f9d6ac460 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/ServerCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/ServerCommand.java @@ -36,8 +36,8 @@ public class ServerCommand implements Command { player.createConnectionRequest(server.get()).fireAndForget(); } else { - String currentServer = ((Player) source).getCurrentServer().map(ServerConnection::getServerInfo) - .map(ServerInfo::getName).orElse(""); + String currentServer = player.getCurrentServer().map(ServerConnection::getServerInfo).map(ServerInfo::getName) + .orElse(""); player.sendMessage(TextComponent.of("You are currently connected to " + currentServer + ".", TextColor.YELLOW)); // Assemble the list of servers as components