Adds the addon name to the world list for version.

https://github.com/BentoBoxWorld/bentobox/issues/285
This commit is contained in:
tastybento 2018-10-14 12:22:27 +09:00
parent 8cc2d1678a
commit ebeaa650d9
3 changed files with 8 additions and 8 deletions

View File

@ -30,7 +30,7 @@ public class BentoBoxVersionCommand extends CompositeCommand {
public boolean execute(User user, String label, List<String> args) {
user.sendMessage("commands.bentobox.version.plugin-version", TextVariables.NAME, getPlugin().getDescription().getVersion());
user.sendMessage("commands.bentobox.version.loaded-game-worlds");
getIWM().getOverWorldNames().forEach(n -> user.sendMessage("commands.bentobox.version.game-worlds", TextVariables.NAME, n));
getIWM().getOverWorldNames().forEach((k,v) -> user.sendMessage("commands.bentobox.version.game-worlds", TextVariables.NAME, k, "[addon]", v));
user.sendMessage("commands.bentobox.version.loaded-addons");
getPlugin().getAddonsManager()
.getAddons()

View File

@ -100,13 +100,13 @@ public class IslandWorldManager {
}
/**
* Get friendly names of all the over worlds
* Get friendly names of all the over worlds and associated addon
*
* @return Set of world names
* @return Map of world names and associated addon or if it's a built-in world "none"
*/
public Set<String> getOverWorldNames() {
return worlds.entrySet().stream().filter(e -> e.getKey().getEnvironment().equals(Environment.NORMAL))
.map(Map.Entry::getValue).collect(Collectors.toSet());
public Map<String, String> getOverWorldNames() {
return worldSettings.values().stream()
.collect(Collectors.toMap(ws -> ws.getWorldName(), ws -> ws.getAddon().map(a -> a.getDescription().getName()).orElse("None")));
}
/**

View File

@ -203,9 +203,9 @@ commands:
plugin-version: "&2Bentobox version: &3[name]"
description: "display info"
loaded-addons: "Loaded Add-Ons"
loaded-game-worlds: "Loaded Game Worlds"
loaded-game-worlds: "Loaded Game Worlds:"
addon-syntax: "&2[name] &3[version]"
game-worlds: "&2[name]"
game-worlds: "&2[name] &3([addon])"
confirmation:
confirm: "&cType command again within &b[seconds]s&c to confirm"
previous-request-cancelled: "&6Previous confirmation request cancelled"