From ebeaa650d9fa8c9a6098e0c490f95b3ff87c9f8f Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 14 Oct 2018 12:22:27 +0900 Subject: [PATCH] Adds the addon name to the world list for version. https://github.com/BentoBoxWorld/bentobox/issues/285 --- .../bentobox/commands/BentoBoxVersionCommand.java | 2 +- .../bentobox/bentobox/managers/IslandWorldManager.java | 10 +++++----- src/main/resources/locales/en-US.yml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/commands/BentoBoxVersionCommand.java b/src/main/java/world/bentobox/bentobox/commands/BentoBoxVersionCommand.java index 8fb95640d..f528ea7e6 100644 --- a/src/main/java/world/bentobox/bentobox/commands/BentoBoxVersionCommand.java +++ b/src/main/java/world/bentobox/bentobox/commands/BentoBoxVersionCommand.java @@ -30,7 +30,7 @@ public class BentoBoxVersionCommand extends CompositeCommand { public boolean execute(User user, String label, List 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() diff --git a/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java b/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java index 26ad4f380..92856e29e 100644 --- a/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java @@ -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 getOverWorldNames() { - return worlds.entrySet().stream().filter(e -> e.getKey().getEnvironment().equals(Environment.NORMAL)) - .map(Map.Entry::getValue).collect(Collectors.toSet()); + public Map getOverWorldNames() { + return worldSettings.values().stream() + .collect(Collectors.toMap(ws -> ws.getWorldName(), ws -> ws.getAddon().map(a -> a.getDescription().getName()).orElse("None"))); } /** diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 464112467..ff7e9f623 100644 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -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"