mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
Close #518 - use csv method for perms command
This commit is contained in:
parent
89edb00c05
commit
ccdf2a89d8
@ -2,6 +2,7 @@ package net.md_5.bungee.command;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import net.md_5.bungee.Util;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
@ -18,15 +19,12 @@ public class CommandPerms extends Command
|
|||||||
@Override
|
@Override
|
||||||
public void execute(CommandSender sender, String[] args)
|
public void execute(CommandSender sender, String[] args)
|
||||||
{
|
{
|
||||||
StringBuilder groups = new StringBuilder();
|
|
||||||
Set<String> permissions = new HashSet<>();
|
Set<String> permissions = new HashSet<>();
|
||||||
for ( String group : sender.getGroups() )
|
for ( String group : sender.getGroups() )
|
||||||
{
|
{
|
||||||
groups.append( group );
|
|
||||||
groups.append( ", " );
|
|
||||||
permissions.addAll( ProxyServer.getInstance().getConfigurationAdapter().getPermissions( group ) );
|
permissions.addAll( ProxyServer.getInstance().getConfigurationAdapter().getPermissions( group ) );
|
||||||
}
|
}
|
||||||
sender.sendMessage( ChatColor.GOLD + "You have the following groups: " + groups.substring( 0, groups.length() - 2 ) );
|
sender.sendMessage( ChatColor.GOLD + "You have the following groups: " + Util.csv( sender.getGroups() ) );
|
||||||
|
|
||||||
for ( String permission : permissions )
|
for ( String permission : permissions )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user