diff --git a/api/src/main/java/net/md_5/bungee/api/config/ServerInfo.java b/api/src/main/java/net/md_5/bungee/api/config/ServerInfo.java index 4ce34bb0..b474bb52 100644 --- a/api/src/main/java/net/md_5/bungee/api/config/ServerInfo.java +++ b/api/src/main/java/net/md_5/bungee/api/config/ServerInfo.java @@ -9,6 +9,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.Synchronized; import net.md_5.bungee.api.Callback; +import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ServerPing; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -92,7 +93,7 @@ public abstract class ServerInfo * @param player the player to check access for * @return whether access is granted to this server */ - public boolean canAccess(ProxiedPlayer player) + public boolean canAccess(CommandSender player) { return !restricted || player.hasPermission( "bungeecord.server." + name ); } diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandList.java b/proxy/src/main/java/net/md_5/bungee/command/CommandList.java index d1060051..511a7ecc 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandList.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandList.java @@ -28,6 +28,11 @@ public class CommandList extends Command { for ( ServerInfo server : ProxyServer.getInstance().getServers().values() ) { + if ( !server.canAccess( sender ) ) + { + continue; + } + Collection serverPlayers = server.getPlayers(); StringBuilder message = new StringBuilder();