syntax = "world <world>",
description = "Print <world> inheritance info",
permission = "permissions.manage.worlds")
public void worldPrintInheritance(PermissionsEx plugin, CommandSender sender, Map<String, String> args) {
String worldName = this.autoCompleteWorldName(args.get("world"));
PermissionManager manager = plugin.getPermissionsManager();
if (plugin.getServer().getWorld(worldName) == null) {
sender.sendMessage("Specified world \"" + args.get("world") + "\" not found.");
return;
}
List<String> parentWorlds = manager.getWorldInheritance(worldName);
if (parentWorlds.isEmpty()) {
sender.sendMessage("World \"" + worldName + "\" inherits nothing.");
return;
}
sender.sendMessage("World \"" + worldName + "\" inherits:");
for (String parentWorld : parentWorlds) {
List<String> parents = manager.getWorldInheritance(parentWorld);
String output = " " + parentWorld;
if (!parents.isEmpty()) {
output += ChatColor.GREEN + " [" + ChatColor.WHITE + StringUtils.implode(parents, ", ") + ChatColor.GREEN + "]";
}