mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 18:17:38 +01:00
Add perm debug command
This commit is contained in:
parent
affecd858a
commit
154722eacc
@ -105,6 +105,7 @@ public class BungeeCord extends ProxyServer
|
|||||||
getPluginManager().registerCommand( new CommandIP() );
|
getPluginManager().registerCommand( new CommandIP() );
|
||||||
getPluginManager().registerCommand( new CommandAlert() );
|
getPluginManager().registerCommand( new CommandAlert() );
|
||||||
getPluginManager().registerCommand( new CommandBungee() );
|
getPluginManager().registerCommand( new CommandBungee() );
|
||||||
|
getPluginManager().registerCommand( new CommandPerms() );
|
||||||
|
|
||||||
registerChannel( "BungeeCord" );
|
registerChannel( "BungeeCord" );
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package net.md_5.bungee.command;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
import net.md_5.bungee.api.CommandSender;
|
||||||
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.plugin.Command;
|
||||||
|
|
||||||
|
public class CommandPerms extends Command
|
||||||
|
{
|
||||||
|
|
||||||
|
public CommandPerms()
|
||||||
|
{
|
||||||
|
super( "perms" );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(CommandSender sender, String[] args)
|
||||||
|
{
|
||||||
|
StringBuilder groups = new StringBuilder();
|
||||||
|
Set<String> 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 ) );
|
||||||
|
|
||||||
|
for ( String permission : permissions )
|
||||||
|
{
|
||||||
|
sender.sendMessage( ChatColor.BLUE + "- " + permission );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user