From ccdf2a89d8f92ff75636d20a6bf25f74b5d97b2a Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 7 Sep 2013 12:22:43 +1000 Subject: [PATCH] Close #518 - use csv method for perms command --- .../src/main/java/net/md_5/bungee/command/CommandPerms.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandPerms.java b/proxy/src/main/java/net/md_5/bungee/command/CommandPerms.java index 79d74d14..610825ca 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandPerms.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandPerms.java @@ -2,6 +2,7 @@ package net.md_5.bungee.command; import java.util.HashSet; import java.util.Set; +import net.md_5.bungee.Util; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; @@ -18,15 +19,12 @@ public class CommandPerms extends Command @Override public void execute(CommandSender sender, String[] args) { - StringBuilder groups = new StringBuilder(); Set permissions = new HashSet<>(); for ( String group : sender.getGroups() ) { - groups.append( group ); - groups.append( ", " ); 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 ) {