this.setPermission("multiverse.portal.list", "Displays a listing of all portals that you can enter.", PermissionDefault.OP);
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
MultiverseWorld world = null;
String filter = null;
if (args.size() > 0) {
world = this.plugin.getCore().getMVWorldManager().getMVWorld(args.get(args.size() - 1));
filter = args.get(0);
}
if (args.size() == 2) {
if (world == null) {
sender.sendMessage("Multiverse does not know about " + ChatColor.GOLD + args.get(1));
return;
}
} else if (world == null && filter == null && args.size() > 0) {
sender.sendMessage("Multiverse does not know about " + ChatColor.GOLD + args.get(1));
return;
}
if (args.size() == 1 && world != null) {
filter = null;
}
String titleString = ChatColor.AQUA + "Portals";
if (world != null) {
titleString += " in " + ChatColor.YELLOW + world.getAlias();
}
if (filter != null) {
titleString += ChatColor.GOLD + " [" + filter + "]";
}
sender.sendMessage(ChatColor.AQUA + "--- " + titleString + ChatColor.AQUA + " ---");