From ab3275cd6952688bcbf3282cb09ab9a198f5151a Mon Sep 17 00:00:00 2001 From: BONNe Date: Tue, 12 Feb 2019 01:38:16 +0200 Subject: [PATCH] Rework Challenges Addon Language structure. Reorganize structure. Add missing translations. Add colors. --- .../challenges/ChallengesImportManager.java | 12 +- .../challenges/ChallengesManager.java | 29 +- .../world/bentobox/challenges/Settings.java | 25 + .../commands/ChallengesCommand.java | 4 +- .../challenges/commands/admin/Challenges.java | 4 +- .../commands/admin/CompleteChallenge.java | 4 +- .../commands/admin/CreateChallenge.java | 6 +- .../commands/admin/CreateSurrounding.java | 14 +- .../commands/admin/ImportCommand.java | 4 +- .../commands/admin/ReloadChallenges.java | 4 +- .../commands/admin/ResetChallenge.java | 6 +- .../commands/admin/ShowChallenges.java | 4 +- .../bentobox/challenges/panel/CommonGUI.java | 2 +- .../challenges/panel/TryToComplete.java | 53 +- .../challenges/panel/admin/AdminGUI.java | 52 +- .../panel/admin/EditChallengeGUI.java | 459 ++++++++++------- .../challenges/panel/admin/EditLevelGUI.java | 128 +++-- .../panel/admin/EditSettingsGUI.java | 76 ++- .../panel/admin/ListChallengesGUI.java | 2 +- .../challenges/panel/admin/ListLevelsGUI.java | 2 +- .../challenges/panel/admin/ListUsersGUI.java | 24 +- .../panel/admin/ManageBlocksGUI.java | 9 +- .../panel/admin/ManageEntitiesGUI.java | 12 +- .../challenges/panel/user/ChallengesGUI.java | 83 ++- .../panel/util/ConfirmationGUI.java | 2 +- .../challenges/panel/util/ItemSwitchGUI.java | 6 +- .../challenges/panel/util/NumberGUI.java | 59 ++- .../panel/util/SelectBlocksGUI.java | 4 +- .../panel/util/SelectChallengeGUI.java | 2 +- .../panel/util/SelectEntityGUI.java | 4 +- .../panel/util/SelectEnvironmentGUI.java | 14 +- .../challenges/panel/util/StringListGUI.java | 22 +- src/main/resources/locales/en-US.yml | 487 ++++++++++-------- 33 files changed, 968 insertions(+), 650 deletions(-) diff --git a/src/main/java/world/bentobox/challenges/ChallengesImportManager.java b/src/main/java/world/bentobox/challenges/ChallengesImportManager.java index ab73edf..82f57f9 100644 --- a/src/main/java/world/bentobox/challenges/ChallengesImportManager.java +++ b/src/main/java/world/bentobox/challenges/ChallengesImportManager.java @@ -56,14 +56,14 @@ public class ChallengesImportManager public boolean importChallenges(User user, World world, boolean overwrite) { File challengeFile = new File(addon.getDataFolder(), "challenges.yml"); if (!challengeFile.exists()) { - user.sendMessage("challenges.admin.import.no-file"); + user.sendMessage("challenges.errors.import-no-file"); return false; } chal = new YamlConfiguration(); try { chal.load(challengeFile); } catch (IOException | InvalidConfigurationException e) { - user.sendMessage("challenges.admin.import.no-load","[message]", e.getMessage()); + user.sendMessage("challenges.errors.no-load","[message]", e.getMessage()); return false; } makeLevels(user, world, overwrite); @@ -76,7 +76,7 @@ public class ChallengesImportManager // Parse the levels String levels = chal.getString("challenges.levels", ""); if (!levels.isEmpty()) { - user.sendMessage("challenges.admin.import.levels", "[levels]", levels); + user.sendMessage("challenges.messages.import-levels"); String[] lvs = levels.split(" "); int order = 0; for (String level : lvs) { @@ -99,7 +99,7 @@ public class ChallengesImportManager addon.getChallengesManager().loadLevel(challengeLevel, overwrite, user, false); } } else { - user.sendMessage("challenges.admin.import.no-levels"); + user.sendMessage("challenges.messages.no-levels"); } } @@ -111,6 +111,8 @@ public class ChallengesImportManager int size = 0; // Parse the challenge file ConfigurationSection chals = chal.getConfigurationSection("challenges.challengeList"); + user.sendMessage("challenges.messages.import-challenges"); + for (String challenge : chals.getKeys(false)) { Challenge newChallenge = new Challenge(); newChallenge.setUniqueId(Util.getWorld(world).getName() + "_" + challenge); @@ -165,7 +167,7 @@ public class ChallengesImportManager } } - user.sendMessage("challenges.admin.import.number", "[number]", String.valueOf(size)); + user.sendMessage("challenges.messages.import-number", "[number]", String.valueOf(size)); } /** diff --git a/src/main/java/world/bentobox/challenges/ChallengesManager.java b/src/main/java/world/bentobox/challenges/ChallengesManager.java index 6cc219e..08ca63b 100644 --- a/src/main/java/world/bentobox/challenges/ChallengesManager.java +++ b/src/main/java/world/bentobox/challenges/ChallengesManager.java @@ -163,8 +163,8 @@ public class ChallengesManager { if (!silent) { - user.sendMessage("challenges.admin.import.skipping", - "[object]", challenge.getFriendlyName()); + user.sendMessage("challenges.messages.load-skipping", + "[value]", challenge.getFriendlyName()); } return false; @@ -173,8 +173,8 @@ public class ChallengesManager { if (!silent) { - user.sendMessage("challenges.admin.import.overwriting", - "[challenge]", challenge.getFriendlyName()); + user.sendMessage("challenges.messages.load-overwriting", + "[value]", challenge.getFriendlyName()); } } } @@ -182,8 +182,8 @@ public class ChallengesManager { if (!silent) { - user.sendMessage("challenges.admin.import.add", - "[object]", challenge.getFriendlyName()); + user.sendMessage("challenges.messages.load-add", + "[value]", challenge.getFriendlyName()); } } @@ -218,8 +218,8 @@ public class ChallengesManager { if (user != null) { - user.sendMessage("challenges.admin.import.error", - "[object]", level.getFriendlyName()); + user.sendMessage("challenges.errors.load-error", + "[value]", level.getFriendlyName()); } else { @@ -235,8 +235,8 @@ public class ChallengesManager { if (!silent) { - user.sendMessage("challenges.admin.import.skipping", - "[object]", level.getFriendlyName()); + user.sendMessage("challenges.messages.load-skipping", + "[value]", level.getFriendlyName()); } return false; @@ -245,8 +245,8 @@ public class ChallengesManager { if (!silent) { - user.sendMessage("challenges.admin.import.overwriting", - "[challenge]", level.getFriendlyName()); + user.sendMessage("challenges.messages.load-overwriting", + "[value]", level.getFriendlyName()); } } } @@ -254,8 +254,8 @@ public class ChallengesManager { if (!silent) { - user.sendMessage("challenges.admin.import.add", - "[object]", level.getFriendlyName()); + user.sendMessage("challenges.messages.load-add", + "[value]", level.getFriendlyName()); } } @@ -281,7 +281,6 @@ public class ChallengesManager } } - // --------------------------------------------------------------------- // Section: Other storing related methods // --------------------------------------------------------------------- diff --git a/src/main/java/world/bentobox/challenges/Settings.java b/src/main/java/world/bentobox/challenges/Settings.java index 143f246..c7543a5 100644 --- a/src/main/java/world/bentobox/challenges/Settings.java +++ b/src/main/java/world/bentobox/challenges/Settings.java @@ -66,12 +66,27 @@ public class Settings implements DataObject @ConfigComment("") private String uniqueId = "config"; + /** + * Configuration version + */ + @ConfigComment("") + private String configVersion = "v1.0"; // --------------------------------------------------------------------- // Section: Methods // --------------------------------------------------------------------- + /** + * This method returns the configVersion object. + * @return the configVersion object. + */ + public String getConfigVersion() + { + return configVersion; + } + + @Override public String getUniqueId() { @@ -143,6 +158,16 @@ public class Settings implements DataObject } + /** + * This method sets the configVersion object value. + * @param configVersion the configVersion object new value. + */ + public void setConfigVersion(String configVersion) + { + this.configVersion = configVersion; + } + + @Override public void setUniqueId(String uniqueId) { diff --git a/src/main/java/world/bentobox/challenges/commands/ChallengesCommand.java b/src/main/java/world/bentobox/challenges/commands/ChallengesCommand.java index 67ddf60..ddbc929 100644 --- a/src/main/java/world/bentobox/challenges/commands/ChallengesCommand.java +++ b/src/main/java/world/bentobox/challenges/commands/ChallengesCommand.java @@ -34,8 +34,8 @@ public class ChallengesCommand extends CompositeCommand { @Override public void setup() { this.setPermission(CHALLENGE_COMMAND); - this.setParametersHelp(CHALLENGE_COMMAND + ".parameters"); - this.setDescription(CHALLENGE_COMMAND + ".description"); + this.setParametersHelp("challenges.commands.user.parameters"); + this.setDescription("challenges.commands.user.description"); } diff --git a/src/main/java/world/bentobox/challenges/commands/admin/Challenges.java b/src/main/java/world/bentobox/challenges/commands/admin/Challenges.java index a73a127..1971c2b 100644 --- a/src/main/java/world/bentobox/challenges/commands/admin/Challenges.java +++ b/src/main/java/world/bentobox/challenges/commands/admin/Challenges.java @@ -21,8 +21,8 @@ public class Challenges extends CompositeCommand { @Override public void setup() { this.setPermission("admin.challenges"); - this.setParametersHelp("challeneges.admin.parameters"); - this.setDescription("challenges.admin.description"); + this.setParametersHelp("challenges.commands.admin.main.parameters"); + this.setDescription("challenges.commands.admin.main.description"); // Register sub commands new ImportCommand(getAddon(), this); // new CompleteChallenge(getAddon(), this); diff --git a/src/main/java/world/bentobox/challenges/commands/admin/CompleteChallenge.java b/src/main/java/world/bentobox/challenges/commands/admin/CompleteChallenge.java index 1a156fe..9893677 100644 --- a/src/main/java/world/bentobox/challenges/commands/admin/CompleteChallenge.java +++ b/src/main/java/world/bentobox/challenges/commands/admin/CompleteChallenge.java @@ -28,8 +28,8 @@ public class CompleteChallenge extends CompositeCommand { @Override public void setup() { this.setPermission("admin.challenges"); - this.setParametersHelp("challenges.admin.complete.parameters"); - this.setDescription("challenges.admin.complete.description"); + this.setParametersHelp("challenges.commands.admin.complete.parameters"); + this.setDescription("challenges.commands.admin.complete.description"); manager = ((ChallengesAddon)getAddon()).getChallengesManager(); } diff --git a/src/main/java/world/bentobox/challenges/commands/admin/CreateChallenge.java b/src/main/java/world/bentobox/challenges/commands/admin/CreateChallenge.java index 4d3f69d..ae450ba 100644 --- a/src/main/java/world/bentobox/challenges/commands/admin/CreateChallenge.java +++ b/src/main/java/world/bentobox/challenges/commands/admin/CreateChallenge.java @@ -29,15 +29,15 @@ public class CreateChallenge extends CompositeCommand { public void setup() { this.setOnlyPlayer(true); this.setPermission("admin.challenges"); - this.setParametersHelp("challaneges.admin.create.parameters"); - this.setDescription("challenges.admin.create.description"); + this.setParametersHelp("challenges.commands.admin.create.parameters"); + this.setDescription("challenges.commands.admin.create.description"); } @Override public boolean execute(User user, String label, List args) { if (args.isEmpty()) { - user.sendRawMessage("not enough args"); + user.sendMessage("challenges.errors.no-name"); return false; } new PanelBuilder() diff --git a/src/main/java/world/bentobox/challenges/commands/admin/CreateSurrounding.java b/src/main/java/world/bentobox/challenges/commands/admin/CreateSurrounding.java index 3ce860a..e9fee1f 100644 --- a/src/main/java/world/bentobox/challenges/commands/admin/CreateSurrounding.java +++ b/src/main/java/world/bentobox/challenges/commands/admin/CreateSurrounding.java @@ -45,18 +45,18 @@ public class CreateSurrounding extends CompositeCommand implements Listener { public void setup() { this.setOnlyPlayer(true); this.setPermission("admin.challenges"); - this.setParametersHelp("challaneges.admin.create.surrounding.parameters"); - this.setDescription("challenges.admin.create.surrounding.description"); + this.setParametersHelp("challenges.commands.admin.surrounding.parameters"); + this.setDescription("challenges.commands.admin.surrounding.description"); } @Override public boolean execute(User user, String label, List args) { if (args.isEmpty()) { - user.sendMessage("challenges.admin.error.no-name"); + user.sendMessage("challenges.errors.no-name"); return false; } // Tell user to hit objects to add to the surrounding object requirements - user.sendMessage("challenges.admin.create.surrounding.hit-things"); + user.sendMessage("challenges.messages.admin.hit-things"); inProgress.put(user.getUniqueId(), new SurroundChallengeBuilder((ChallengesAddon) getAddon()).owner(user).name(args.get(0))); return true; } @@ -77,7 +77,7 @@ public class CreateSurrounding extends CompositeCommand implements Listener { // Prevent damage e.setCancelled(true); inProgress.get(e.getPlayer().getUniqueId()).addBlock(e.getClickedBlock().getType()); - User.getInstance(e.getPlayer()).sendMessage("challenges.admin.you-added", "[thing]", Util.prettifyText(e.getClickedBlock().getType().toString())); + User.getInstance(e.getPlayer()).sendMessage("challenges.messages.admin.you-added", "[thing]", Util.prettifyText(e.getClickedBlock().getType().toString())); return true; } @@ -92,7 +92,7 @@ public class CreateSurrounding extends CompositeCommand implements Listener { e.setCancelled(true); boolean status = inProgress.get(uuid).build(); if (status) { - inProgress.get(uuid).getOwner().sendMessage("challenges.admin.challenge-created", "[challenge]", inProgress.get(uuid).getName()); + inProgress.get(uuid).getOwner().sendMessage("challenges.messages.admin.challenge-created", "[challenge]", inProgress.get(uuid).getName()); } inProgress.remove(uuid); return status; @@ -115,7 +115,7 @@ public class CreateSurrounding extends CompositeCommand implements Listener { // Prevent damage e.setCancelled(true); inProgress.get(player.getUniqueId()).addEntity(e.getEntityType()); - User.getInstance(player).sendMessage("challenges.admin.you-added", "[thing]", Util.prettifyText(e.getEntityType().toString())); + User.getInstance(player).sendMessage("challenges.messages.admin.you-added", "[thing]", Util.prettifyText(e.getEntityType().toString())); return true; } return false; diff --git a/src/main/java/world/bentobox/challenges/commands/admin/ImportCommand.java b/src/main/java/world/bentobox/challenges/commands/admin/ImportCommand.java index bdf8791..882a70a 100644 --- a/src/main/java/world/bentobox/challenges/commands/admin/ImportCommand.java +++ b/src/main/java/world/bentobox/challenges/commands/admin/ImportCommand.java @@ -29,8 +29,8 @@ public class ImportCommand extends CompositeCommand { @Override public void setup() { this.setPermission("challenges.admin"); - this.setParametersHelp("challenges.admin.import.parameters"); - this.setDescription("challenges.admin.import.description"); + this.setParametersHelp("challenges.commands.admin.import.parameters"); + this.setDescription("challenges.commands.admin.import.description"); } @Override diff --git a/src/main/java/world/bentobox/challenges/commands/admin/ReloadChallenges.java b/src/main/java/world/bentobox/challenges/commands/admin/ReloadChallenges.java index ad7caf3..72b751e 100644 --- a/src/main/java/world/bentobox/challenges/commands/admin/ReloadChallenges.java +++ b/src/main/java/world/bentobox/challenges/commands/admin/ReloadChallenges.java @@ -23,8 +23,8 @@ public class ReloadChallenges extends CompositeCommand { @Override public void setup() { this.setPermission("admin.challenges"); - this.setParametersHelp("challenges.admin.reload.parameters"); - this.setDescription("challenges.admin.reload.description"); + this.setParametersHelp("challenges.commands.admin.reload.parameters"); + this.setDescription("challenges.commands.admin.reload.description"); manager = ((ChallengesAddon)getAddon()).getChallengesManager(); } diff --git a/src/main/java/world/bentobox/challenges/commands/admin/ResetChallenge.java b/src/main/java/world/bentobox/challenges/commands/admin/ResetChallenge.java index 5e762d5..c733a0e 100644 --- a/src/main/java/world/bentobox/challenges/commands/admin/ResetChallenge.java +++ b/src/main/java/world/bentobox/challenges/commands/admin/ResetChallenge.java @@ -33,8 +33,8 @@ public class ResetChallenge extends CompositeCommand { @Override public void setup() { this.setPermission("admin.challenges"); - this.setParametersHelp("challenges.admin.reset.parameters"); - this.setDescription("challenges.admin.reset.description"); + this.setParametersHelp("challenges.commands.admin.reset.parameters"); + this.setDescription("challenges.commands.admin.reset.description"); manager = ((ChallengesAddon)getAddon()).getChallengesManager(); } @@ -57,7 +57,7 @@ public class ResetChallenge extends CompositeCommand { } // Check for valid challenge name if (!manager.containsChallenge(args.get(1))) { - user.sendMessage("challenges.admin.complete.unknown-challenge"); + user.sendMessage("challenges.errors.unknown-challenge"); return false; } // Complete challenge diff --git a/src/main/java/world/bentobox/challenges/commands/admin/ShowChallenges.java b/src/main/java/world/bentobox/challenges/commands/admin/ShowChallenges.java index 97eb1bb..9ea60f7 100644 --- a/src/main/java/world/bentobox/challenges/commands/admin/ShowChallenges.java +++ b/src/main/java/world/bentobox/challenges/commands/admin/ShowChallenges.java @@ -21,8 +21,8 @@ public class ShowChallenges extends CompositeCommand { @Override public void setup() { this.setPermission("admin.challenges"); - this.setParametersHelp("challaneges.admin.show.parameters"); - this.setDescription("challenges.admin.show.description"); + this.setParametersHelp("challenges.commands.admin.show.parameters"); + this.setDescription("challenges.commands.admin.show.description"); } diff --git a/src/main/java/world/bentobox/challenges/panel/CommonGUI.java b/src/main/java/world/bentobox/challenges/panel/CommonGUI.java index 5e08cbe..b1a9d7b 100644 --- a/src/main/java/world/bentobox/challenges/panel/CommonGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/CommonGUI.java @@ -157,7 +157,7 @@ public abstract class CommonGUI this.pageIndex = 0; this.returnButton = new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.buttons.back")). + name(this.user.getTranslation("challenges.gui.buttons.return")). icon(Material.OAK_DOOR). clickHandler((panel, user1, clickType, i) -> { if (this.parentGUI == null) diff --git a/src/main/java/world/bentobox/challenges/panel/TryToComplete.java b/src/main/java/world/bentobox/challenges/panel/TryToComplete.java index 3107f84..8f26720 100644 --- a/src/main/java/world/bentobox/challenges/panel/TryToComplete.java +++ b/src/main/java/world/bentobox/challenges/panel/TryToComplete.java @@ -226,7 +226,7 @@ public class TryToComplete // Run commands this.runCommands(this.challenge.getRewardCommands()); - this.user.sendMessage("challenges.you-completed", "[challenge]", this.challenge.getFriendlyName()); + this.user.sendMessage("challenges.messages.you-completed-challenge", "[value]", this.challenge.getFriendlyName()); if (this.addon.getChallengesSettings().isBroadcastMessages()) { @@ -235,8 +235,9 @@ public class TryToComplete // Only other players should see message. if (!player.getUniqueId().equals(this.user.getUniqueId())) { - User.getInstance(player).sendMessage("challenges.name-has-completed", - "[name]", this.user.getName(), "[challenge]", this.challenge.getFriendlyName()); + User.getInstance(player).sendMessage("challenges.messages.name-has-completed-challenge", + "[name]", this.user.getName(), + "[value]", this.challenge.getFriendlyName()); } } } @@ -262,7 +263,7 @@ public class TryToComplete // Run commands this.runCommands(this.challenge.getRepeatRewardCommands()); - this.user.sendMessage("challenges.you-repeated", "[challenge]", this.challenge.getFriendlyName()); + this.user.sendMessage("challenges.messages.you-repeated-challenge", "[value]", this.challenge.getFriendlyName()); } // Mark as complete @@ -295,7 +296,7 @@ public class TryToComplete // Run commands this.runCommands(level.getRewardCommands()); - this.user.sendMessage("challenges.you-completed-level", "[level]", level.getFriendlyName()); + this.user.sendMessage("challenges.messages.you-completed-level", "[value]", level.getFriendlyName()); if (this.addon.getChallengesSettings().isBroadcastMessages()) { @@ -304,8 +305,8 @@ public class TryToComplete // Only other players should see message. if (!player.getUniqueId().equals(this.user.getUniqueId())) { - User.getInstance(player).sendMessage("challenges.name-has-completed-level", - "[name]", this.user.getName(), "[level]", level.getFriendlyName()); + User.getInstance(player).sendMessage("challenges.messages.name-has-completed-level", + "[name]", this.user.getName(), "[value]", level.getFriendlyName()); } } } @@ -332,7 +333,7 @@ public class TryToComplete // Check the world if (!this.challenge.isDeployed()) { - this.user.sendMessage("challenges.error.not-deployed"); + this.user.sendMessage("challenges.errors.not-deployed"); result = EMPTY_RESULT; } else if (Util.getWorld(this.world) != Util.getWorld(this.user.getWorld()) || @@ -344,7 +345,7 @@ public class TryToComplete // Player is not on island else if (!this.addon.getIslands().userIsOnIsland(this.user.getWorld(), this.user)) { - this.user.sendMessage("challenges.error.not-on-island"); + this.user.sendMessage("challenges.errors.not-on-island"); result = EMPTY_RESULT; } // Check if user has unlocked challenges level. @@ -358,13 +359,13 @@ public class TryToComplete else if (this.challenge.isRepeatable() && this.challenge.getMaxTimes() > 0 && this.manager.getChallengeTimes(this.user, this.challenge) >= this.challenge.getMaxTimes()) { - this.user.sendMessage("challenges.not-repeatable"); + this.user.sendMessage("challenges.errors.not-repeatable"); result = EMPTY_RESULT; } // Check repeatability else if (!this.challenge.isRepeatable() && this.manager.isChallengeComplete(this.user, this.challenge)) { - this.user.sendMessage("challenges.not-repeatable"); + this.user.sendMessage("challenges.errors.not-repeatable"); result = EMPTY_RESULT; } // Check environment @@ -503,7 +504,7 @@ public class TryToComplete if (numInInventory < req.getAmount()) { - this.user.sendMessage("challenges.error.not-enough-items", + this.user.sendMessage("challenges.errors.not-enough-items", "[items]", Util.prettifyText(req.getType().toString())); return EMPTY_RESULT; @@ -513,7 +514,7 @@ public class TryToComplete // General checking if (!this.user.getInventory().containsAtLeast(req, req.getAmount())) { - this.user.sendMessage("challenges.error.not-enough-items", + this.user.sendMessage("challenges.errors.not-enough-items", "[items]", Util.prettifyText(req.getType().toString())); return EMPTY_RESULT; @@ -598,7 +599,7 @@ public class TryToComplete if (!this.addon.getIslands().userIsOnIsland(this.user.getWorld(), this.user)) { // Player is not on island - this.user.sendMessage("challenges.error.not-on-island"); + this.user.sendMessage("challenges.errors.not-on-island"); result = EMPTY_RESULT; } else @@ -662,9 +663,9 @@ public class TryToComplete return new ChallengeResult().setMeetsRequirements(); } - this.user.sendMessage("challenges.error.not-close-enough", "[number]", String.valueOf(searchRadius)); + this.user.sendMessage("challenges.errors.not-close-enough", "[number]", String.valueOf(searchRadius)); - blocks.forEach((k, v) -> user.sendMessage("challenges.error.you-still-need", + blocks.forEach((k, v) -> user.sendMessage("challenges.errors.you-still-need", "[amount]", String.valueOf(v), "[item]", Util.prettifyText(k.toString()))); @@ -693,7 +694,7 @@ public class TryToComplete return new ChallengeResult().setMeetsRequirements(); } - entities.forEach((reqEnt, amount) -> this.user.sendMessage("challenges.error.you-still-need", + entities.forEach((reqEnt, amount) -> this.user.sendMessage("challenges.errors.you-still-need", "[amount]", String.valueOf(amount), "[item]", Util.prettifyText(reqEnt.toString()))); @@ -767,38 +768,38 @@ public class TryToComplete if (!this.addon.isLevelProvided() && this.challenge.getRequiredIslandLevel() != 0) { - this.user.sendMessage("challenges.missing-addon"); + this.user.sendMessage("challenges.errors.missing-addon"); } else if (!this.addon.isEconomyProvided() && this.challenge.getRequiredMoney() != 0) { - this.user.sendMessage("challenges.missing-addon"); + this.user.sendMessage("challenges.errors.missing-addon"); } else if (this.addon.isEconomyProvided() && this.challenge.getRequiredMoney() < 0) { - this.user.sendMessage("challenges.incorrect"); + this.user.sendMessage("challenges.errors.incorrect"); } else if (this.addon.isEconomyProvided() && !this.addon.getEconomyProvider().has(this.user, this.challenge.getRequiredMoney())) { - this.user.sendMessage("challenges.not-enough-money", - "[money]", + this.user.sendMessage("challenges.errors.not-enough-money", + "[value]", Integer.toString(this.challenge.getRequiredMoney())); } else if (this.challenge.getRequiredExperience() < 0) { - this.user.sendMessage("challenges.incorrect"); + this.user.sendMessage("challenges.errors.incorrect"); } else if (this.user.getPlayer().getTotalExperience() < this.challenge.getRequiredExperience()) { - this.user.sendMessage("challenges.not-enough-exp", - "[xp]", + this.user.sendMessage("challenges.errors.not-enough-experience", + "[value]", Integer.toString(this.challenge.getRequiredExperience())); } else if (this.addon.isLevelProvided() && this.addon.getLevelAddon().getIslandLevel(this.world, this.user.getUniqueId()) < this.challenge.getRequiredIslandLevel()) { - this.user.sendMessage("challenges.error.island-level", + this.user.sendMessage("challenges.errors.island-level", TextVariables.NUMBER, String.valueOf(this.challenge.getRequiredIslandLevel())); } diff --git a/src/main/java/world/bentobox/challenges/panel/admin/AdminGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/AdminGUI.java index 462c2f4..ae8e669 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/AdminGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/AdminGUI.java @@ -4,8 +4,6 @@ package world.bentobox.challenges.panel.admin; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.inventory.ItemStack; -import java.util.Collections; -import java.util.List; import net.wesjd.anvilgui.AnvilGUI; import world.bentobox.bentobox.api.panels.PanelItem; @@ -90,7 +88,7 @@ public class AdminGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name( - this.user.getTranslation("challenges.admin.gui-title")); + this.user.getTranslation("challenges.gui.title.admin.gui-title")); GuiUtils.fillBorder(panelBuilder); @@ -132,7 +130,7 @@ public class AdminGUI extends CommonGUI { ItemStack icon; String name; - List description; + String description; boolean glow; PanelItem.ClickHandler clickHandler; @@ -143,8 +141,8 @@ public class AdminGUI extends CommonGUI case COMPLETE_USER_CHALLENGES: permissionSuffix = COMPLETE; - name = this.user.getTranslation("challenges.gui.admin.buttons.complete"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.complete"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.complete"); icon = new ItemStack(Material.WRITTEN_BOOK); clickHandler = (panel, user, clickType, slot) -> { new ListUsersGUI(this.addon, @@ -163,8 +161,8 @@ public class AdminGUI extends CommonGUI case RESET_USER_CHALLENGES: permissionSuffix = RESET; - name = this.user.getTranslation("challenges.gui.admin.buttons.reset"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.reset"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.reset"); icon = new ItemStack(Material.WRITABLE_BOOK); glow = this.resetAllMode; @@ -193,8 +191,8 @@ public class AdminGUI extends CommonGUI case ADD_CHALLENGE: permissionSuffix = ADD; - name = this.user.getTranslation("challenges.gui.admin.buttons.add-challenge"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.create-challenge"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.create-challenge"); icon = new ItemStack(Material.BOOK); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -229,8 +227,8 @@ public class AdminGUI extends CommonGUI case ADD_LEVEL: permissionSuffix = ADD; - name = this.user.getTranslation("challenges.gui.admin.buttons.add-level"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.create-level"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.create-level"); icon = new ItemStack(Material.BOOK); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -265,8 +263,8 @@ public class AdminGUI extends CommonGUI case EDIT_CHALLENGE: permissionSuffix = EDIT; - name = this.user.getTranslation("challenges.gui.admin.buttons.edit-challenge"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.edit-challenge"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.edit-challenge"); icon = new ItemStack(Material.ANVIL); clickHandler = (panel, user, clickType, slot) -> { new ListChallengesGUI(this.addon, @@ -286,8 +284,8 @@ public class AdminGUI extends CommonGUI { permissionSuffix = EDIT; - name = this.user.getTranslation("challenges.gui.admin.buttons.edit-level"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.edit-level"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.edit-level"); icon = new ItemStack(Material.ANVIL); clickHandler = (panel, user, clickType, slot) -> { new ListLevelsGUI(this.addon, @@ -308,8 +306,8 @@ public class AdminGUI extends CommonGUI { permissionSuffix = DELETE; - name = this.user.getTranslation("challenges.gui.admin.buttons.delete-challenge"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.delete-challenge"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.delete-challenge"); icon = new ItemStack(Material.LAVA_BUCKET); clickHandler = (panel, user, clickType, slot) -> { new ListChallengesGUI(this.addon, @@ -330,8 +328,8 @@ public class AdminGUI extends CommonGUI { permissionSuffix = DELETE; - name = this.user.getTranslation("challenges.gui.admin.buttons.delete-level"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.delete-level"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.delete-level"); icon = new ItemStack(Material.LAVA_BUCKET); clickHandler = (panel, user, clickType, slot) -> { new ListLevelsGUI(this.addon, @@ -352,8 +350,8 @@ public class AdminGUI extends CommonGUI { permissionSuffix = IMPORT; - name = this.user.getTranslation("challenges.gui.admin.buttons.import"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.import"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.import"); icon = new ItemStack(Material.HOPPER); clickHandler = (panel, user, clickType, slot) -> { if (clickType.isRightClick()) @@ -377,8 +375,8 @@ public class AdminGUI extends CommonGUI { permissionSuffix = IMPORT; - name = this.user.getTranslation("challenges.gui.admin.buttons.backward"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.backward"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.backward"); icon = new ItemStack(Material.HOPPER); clickHandler = (panel, user, clickType, slot) -> { this.addon.getImportManager(). @@ -394,8 +392,8 @@ public class AdminGUI extends CommonGUI { permissionSuffix = SETTINGS; - name = this.user.getTranslation("challenges.gui.admin.buttons.settings"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.settings"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.settings"); icon = new ItemStack(Material.CRAFTING_TABLE); clickHandler = (panel, user, clickType, slot) -> { new EditSettingsGUI(this.addon, @@ -428,6 +426,6 @@ public class AdminGUI extends CommonGUI }; } - return new PanelItem(icon, name, description, glow, clickHandler, false); + return new PanelItem(icon, name, GuiUtils.stringSplit(description, this.addon.getChallengesSettings().getLoreLineLength()), glow, clickHandler, false); } } \ No newline at end of file diff --git a/src/main/java/world/bentobox/challenges/panel/admin/EditChallengeGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/EditChallengeGUI.java index 28cec3e..8efe40f 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/EditChallengeGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/EditChallengeGUI.java @@ -3,6 +3,7 @@ package world.bentobox.challenges.panel.admin; import org.bukkit.Material; import org.bukkit.World; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; import java.util.*; @@ -80,7 +81,7 @@ public class EditChallengeGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name( - this.user.getTranslation("challenges.gui.admin.edit-challenge-title")); + this.user.getTranslation("challenges.gui.title.admin.edit-challenge-title")); GuiUtils.fillBorder(panelBuilder); @@ -228,7 +229,7 @@ public class EditChallengeGUI extends CommonGUI { ItemStack icon; String name; - List description; + String description; boolean glow; PanelItem.ClickHandler clickHandler; @@ -236,8 +237,8 @@ public class EditChallengeGUI extends CommonGUI { case PROPERTIES: { - name = this.user.getTranslation("challenges.gui.admin.buttons.properties"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.properties"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.properties"); icon = new ItemStack(Material.CRAFTING_TABLE); clickHandler = (panel, user, clickType, slot) -> { this.currentMenuType = MenuType.PROPERTIES; @@ -250,8 +251,8 @@ public class EditChallengeGUI extends CommonGUI } case REQUIREMENTS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.requirements"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.requirements"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.requirements"); icon = new ItemStack(Material.HOPPER); clickHandler = (panel, user, clickType, slot) -> { this.currentMenuType = MenuType.REQUIREMENTS; @@ -264,8 +265,8 @@ public class EditChallengeGUI extends CommonGUI } case REWARDS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.rewards"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.rewards"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.rewards"); icon = new ItemStack(Material.DROPPER); clickHandler = (panel, user, clickType, slot) -> { this.currentMenuType = MenuType.REWARDS; @@ -303,16 +304,21 @@ public class EditChallengeGUI extends CommonGUI { case TYPE: { - List values = new ArrayList<>(Challenge.ChallengeType.values().length); + name = this.user.getTranslation("challenges.gui.buttons.admin.type"); - for (Challenge.ChallengeType type : Challenge.ChallengeType.values()) - { - values.add((this.challenge.getChallengeType().equals(type) ? "&2" : "&c") + - this.user.getTranslation("challenges.gui.admin.descriptions." + type.name().toLowerCase())); - } + List values = new ArrayList<>(5); + values.add(this.user.getTranslation("challenges.gui.descriptions.admin.type")); + + values.add((this.challenge.getChallengeType().equals(Challenge.ChallengeType.ISLAND) ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.type.island")); + values.add((this.challenge.getChallengeType().equals(Challenge.ChallengeType.INVENTORY) ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.type.inventory")); + values.add((this.challenge.getChallengeType().equals(Challenge.ChallengeType.OTHER) ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.type.other")); + + values.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", this.challenge.getChallengeType().name())); - name = this.user.getTranslation("challenges.gui.admin.buttons.type", - "[value]", this.challenge.getChallengeType().name()); description = values; if (this.challenge.getChallengeType().equals(Challenge.ChallengeType.ISLAND)) @@ -353,16 +359,15 @@ public class EditChallengeGUI extends CommonGUI } case DEPLOYED: { - name = this.user.getTranslation("challenges.gui.admin.buttons.deployed"); + name = this.user.getTranslation("challenges.gui.buttons.admin.deployment"); - if (this.challenge.isDeployed()) - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.enabled")); - } - else - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.disabled")); - } + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.deployment")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.challenge.isDeployed() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); icon = new ItemStack(Material.LEVER); clickHandler = (panel, user, clickType, slot) -> { @@ -376,8 +381,9 @@ public class EditChallengeGUI extends CommonGUI } case ICON: { - name = this.user.getTranslation("challenges.gui.admin.buttons.icon"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.icon"); + description = Collections.singletonList(this.user.getTranslation( + "challenges.gui.descriptions.admin.icon-challenge")); icon = this.challenge.getIcon(); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -406,8 +412,8 @@ public class EditChallengeGUI extends CommonGUI } case DESCRIPTION: { - name = this.user.getTranslation("challenges.gui.admin.buttons.description"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.description"); + description = Collections.singletonList(this.user.getTranslation("challenges.gui.descriptions.admin.description")); icon = new ItemStack(Material.WRITTEN_BOOK); clickHandler = (panel, user, clickType, slot) -> { new StringListGUI(this.user, this.challenge.getDescription(), lineLength, (status, value) -> { @@ -426,11 +432,12 @@ public class EditChallengeGUI extends CommonGUI } case ORDER: { - name = this.user.getTranslation("challenges.gui.admin.buttons.order"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.order", - "[value]", - Integer.toString(this.challenge.getOrder()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.order"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.order")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challenge.getOrder()))); + icon = new ItemStack(Material.DROPPER); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challenge.getOrder(), -1, 54, (status, value) -> { @@ -449,16 +456,18 @@ public class EditChallengeGUI extends CommonGUI } case ENVIRONMENT: { - List values = new ArrayList<>(World.Environment.values().length); + name = this.user.getTranslation("challenges.gui.buttons.admin.environment"); - for (World.Environment environment : World.Environment.values()) - { - values.add((this.challenge.getEnvironment().contains(environment.name()) ? "&2" : "&c") + - this.user.getTranslation("challenges.gui.admin.descriptions." + environment.name().toLowerCase())); - } + description = new ArrayList<>(4); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.environment")); + + description.add((this.challenge.getEnvironment().contains(World.Environment.NORMAL) ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.normal")); + description.add((this.challenge.getEnvironment().contains(World.Environment.NETHER) ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.nether")); + description.add((this.challenge.getEnvironment().contains(World.Environment.THE_END) ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.the-end")); - name = this.user.getTranslation("challenges.gui.admin.buttons.environment"); - description = values; icon = new ItemStack(Material.DROPPER); clickHandler = (panel, user, clickType, slot) -> { new SelectEnvironmentGUI(this.user, this.challenge.getEnvironment(), (status, value) -> { @@ -477,8 +486,14 @@ public class EditChallengeGUI extends CommonGUI } case REMOVE_ON_COMPLETE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.remove-on-complete"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.remove-on-complete"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.remove-on-complete")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.challenge.isRemoveWhenCompleted() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); if (this.challenge.isRemoveWhenCompleted()) { @@ -500,8 +515,12 @@ public class EditChallengeGUI extends CommonGUI } case NAME: { - name = this.user.getTranslation("challenges.gui.admin.buttons.name"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.name"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.name-challenge")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", this.challenge.getFriendlyName())); + icon = new ItemStack(Material.DROPPER); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -521,15 +540,18 @@ public class EditChallengeGUI extends CommonGUI case REQUIRED_ENTITIES: { - List values = new ArrayList<>(this.challenge.getRequiredEntities().size()); + name = this.user.getTranslation("challenges.gui.buttons.admin.required-entities"); + + description = new ArrayList<>(this.challenge.getRequiredEntities().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.required-entities")); for (Map.Entry entry : this.challenge.getRequiredEntities().entrySet()) { - values.add(entry.getKey().name() + " " + entry.getValue()); + description.add(this.user.getTranslation("challenges.gui.descriptions.entity", + "[entity]", entry.getKey().name(), + "[count]", Integer.toString(entry.getValue()))); } - name = this.user.getTranslation("challenges.gui.admin.buttons.entities"); - description = values; icon = new ItemStack(Material.CREEPER_HEAD); clickHandler = (panel, user, clickType, slot) -> { new ManageEntitiesGUI(this.addon, @@ -547,16 +569,14 @@ public class EditChallengeGUI extends CommonGUI } case REMOVE_ENTITIES: { - name = this.user.getTranslation("challenges.gui.admin.buttons.remove-entities"); - - if (this.challenge.isRemoveEntities()) - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.enabled")); - } - else - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.disabled")); - } + name = this.user.getTranslation("challenges.gui.buttons.admin.remove-entities"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.remove-entities")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.challenge.isRemoveEntities() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); icon = new ItemStack(Material.LEVER); clickHandler = (panel, user, clickType, slot) -> { @@ -570,15 +590,18 @@ public class EditChallengeGUI extends CommonGUI } case REQUIRED_BLOCKS: { - List values = new ArrayList<>(this.challenge.getRequiredBlocks().size()); + name = this.user.getTranslation("challenges.gui.buttons.admin.required-blocks"); + + description = new ArrayList<>(this.challenge.getRequiredEntities().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.required-blocks")); for (Map.Entry entry : this.challenge.getRequiredBlocks().entrySet()) { - values.add(entry.getKey().name() + " " + entry.getValue()); + description.add(this.user.getTranslation("challenges.gui.descriptions.block", + "[block]", entry.getKey().name(), + "[count]", Integer.toString(entry.getValue()))); } - name = this.user.getTranslation("challenges.gui.admin.buttons.blocks"); - description = values; icon = new ItemStack(Material.STONE); clickHandler = (panel, user, clickType, slot) -> { new ManageBlocksGUI(this.addon, @@ -596,16 +619,14 @@ public class EditChallengeGUI extends CommonGUI } case REMOVE_BLOCKS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.remove-blocks"); - - if (this.challenge.isRemoveBlocks()) - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.enabled")); - } - else - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.disabled")); - } + name = this.user.getTranslation("challenges.gui.buttons.admin.remove-blocks"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.remove-blocks")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.challenge.isRemoveBlocks() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); icon = new ItemStack(Material.LEVER); clickHandler = (panel, user, clickType, slot) -> { @@ -619,11 +640,12 @@ public class EditChallengeGUI extends CommonGUI } case SEARCH_RADIUS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.search-radius"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.search-radius", - "[value]", - Integer.toString(this.challenge.getSearchRadius()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.search-radius"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.search-radius")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challenge.getSearchRadius()))); + icon = new ItemStack(Material.COBBLESTONE_WALL); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challenge.getSearchRadius(), 0, (status, value) -> { @@ -642,8 +664,17 @@ public class EditChallengeGUI extends CommonGUI } case REQUIRED_PERMISSIONS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.permissions"); - description = new ArrayList<>(this.challenge.getRequiredPermissions()); + name = this.user.getTranslation("challenges.gui.buttons.admin.required-permissions"); + description = new ArrayList<>(this.challenge.getRequiredPermissions().size() + 1); + description.add(this.user.getTranslation( + "challenges.gui.descriptions.admin.required-permissions")); + + for (String permission : this.challenge.getRequiredPermissions()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.permission", + "[permission]", permission)); + } + icon = new ItemStack(Material.REDSTONE_LAMP); clickHandler = (panel, user, clickType, slot) -> { new StringListGUI(this.user, this.challenge.getRequiredPermissions(), lineLength, (status, value) -> { @@ -662,15 +693,30 @@ public class EditChallengeGUI extends CommonGUI } case REQUIRED_ITEMS: { - List values = new ArrayList<>(this.challenge.getRequiredItems().size()); + name = this.user.getTranslation("challenges.gui.buttons.admin.required-items"); + + description = new ArrayList<>(this.challenge.getRequiredEntities().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.required-items")); for (ItemStack itemStack : this.challenge.getRequiredItems()) { - values.add(itemStack.getType().name() + " " + itemStack.getAmount()); + description.add(this.user.getTranslation("challenges.gui.descriptions.item", + "[item]", itemStack.getType().name(), + "[count]", Integer.toString(itemStack.getAmount()))); + + if (itemStack.hasItemMeta() && itemStack.getEnchantments().isEmpty()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.item-meta", + "[meta]", itemStack.getItemMeta().toString())); + } + + for (Map.Entry entry : itemStack.getEnchantments().entrySet()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.item-enchant", + "[enchant]", entry.getKey().getKey().getKey(), "[level]", Integer.toString(entry.getValue()))); + } } - name = this.user.getTranslation("challenges.gui.admin.buttons.required-items"); - description = values; icon = new ItemStack(Material.CHEST); clickHandler = (panel, user, clickType, slot) -> { new ItemSwitchGUI(this.user, this.challenge.getRequiredItems(), lineLength, (status, value) -> { @@ -689,16 +735,14 @@ public class EditChallengeGUI extends CommonGUI } case REMOVE_ITEMS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.remove-items"); - - if (this.challenge.isTakeItems()) - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.enabled")); - } - else - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.disabled")); - } + name = this.user.getTranslation("challenges.gui.buttons.admin.remove-items"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.remove-items")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.challenge.isTakeItems() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); icon = new ItemStack(Material.LEVER); clickHandler = (panel, user, clickType, slot) -> { @@ -712,11 +756,12 @@ public class EditChallengeGUI extends CommonGUI } case REQUIRED_EXPERIENCE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.required-exp"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.required-exp", - "[value]", - Integer.toString(this.challenge.getRequiredExperience()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.required-experience"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.required-experience")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challenge.getRequiredExperience()))); + icon = new ItemStack(Material.EXPERIENCE_BOTTLE); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challenge.getRequiredExperience(), 0, (status, value) -> { @@ -734,16 +779,14 @@ public class EditChallengeGUI extends CommonGUI } case REMOVE_EXPERIENCE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.remove-exp"); - - if (this.challenge.isTakeExperience()) - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.enabled")); - } - else - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.disabled")); - } + name = this.user.getTranslation("challenges.gui.buttons.admin.remove-experience"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.remove-experience")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.challenge.isTakeExperience() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); icon = new ItemStack(Material.LEVER); clickHandler = (panel, user, clickType, slot) -> { @@ -757,11 +800,11 @@ public class EditChallengeGUI extends CommonGUI } case REQUIRED_LEVEL: { - name = this.user.getTranslation("challenges.gui.admin.buttons.required-level"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.required-level", - "[value]", - Long.toString(this.challenge.getRequiredIslandLevel()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.required-level"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.required-level")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Long.toString(this.challenge.getRequiredIslandLevel()))); if (this.addon.isLevelProvided()) { @@ -790,11 +833,11 @@ public class EditChallengeGUI extends CommonGUI } case REQUIRED_MONEY: { - name = this.user.getTranslation("challenges.gui.admin.buttons.required-money"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.required-money", - "[value]", - Integer.toString(this.challenge.getRequiredMoney()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.required-money"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.required-money")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Long.toString(this.challenge.getRequiredIslandLevel()))); if (this.addon.isEconomyProvided()) { @@ -822,18 +865,14 @@ public class EditChallengeGUI extends CommonGUI } case REMOVE_MONEY: { - name = this.user.getTranslation("challenges.gui.admin.buttons.remove-money"); - - if (this.challenge.isTakeMoney()) - { - description = Collections.singletonList(this.user - .getTranslation("challenges.gui.admin.descriptions.enabled")); - } - else - { - description = Collections.singletonList(this.user - .getTranslation("challenges.gui.admin.descriptions.disabled")); - } + name = this.user.getTranslation("challenges.gui.buttons.admin.remove-money"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.remove-money")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.challenge.isTakeMoney() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); if (this.addon.isEconomyProvided()) { @@ -857,8 +896,12 @@ public class EditChallengeGUI extends CommonGUI case REWARD_TEXT: { - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-text"); - description = Collections.singletonList(this.challenge.getRewardText()); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-text"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-text")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", "|" + this.challenge.getRewardText())); + icon = new ItemStack(Material.WRITTEN_BOOK); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -877,15 +920,30 @@ public class EditChallengeGUI extends CommonGUI } case REWARD_ITEM: { - List values = new ArrayList<>(this.challenge.getRewardItems().size()); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-items"); + + description = new ArrayList<>(this.challenge.getRewardItems().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-items")); for (ItemStack itemStack : this.challenge.getRewardItems()) { - values.add(itemStack.getType().name() + " " + itemStack.getAmount()); + description.add(this.user.getTranslation("challenges.gui.descriptions.item", + "[item]", itemStack.getType().name(), + "[count]", Integer.toString(itemStack.getAmount()))); + + if (itemStack.hasItemMeta() && itemStack.getEnchantments().isEmpty()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.item-meta", + "[meta]", itemStack.getItemMeta().toString())); + } + + for (Map.Entry entry : itemStack.getEnchantments().entrySet()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.item-enchant", + "[enchant]", entry.getKey().getKey().getKey(), "[level]", Integer.toString(entry.getValue()))); + } } - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-items"); - description = values; icon = new ItemStack(Material.CHEST); clickHandler = (panel, user, clickType, slot) -> { new ItemSwitchGUI(this.user, this.challenge.getRewardItems(), lineLength, (status, value) -> { @@ -904,11 +962,11 @@ public class EditChallengeGUI extends CommonGUI } case REWARD_EXPERIENCE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-exp"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.reward-exp", - "[value]", - Integer.toString(this.challenge.getRewardExperience()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-experience"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-experience")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challenge.getRewardExperience()))); icon = new ItemStack(Material.EXPERIENCE_BOTTLE); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challenge.getRewardExperience(), 0, (status, value) -> { @@ -927,11 +985,11 @@ public class EditChallengeGUI extends CommonGUI } case REWARD_MONEY: { - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-money"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.reward-money", - "[value]", - Integer.toString(this.challenge.getRewardMoney()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-money"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-money")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challenge.getRewardMoney()))); if (this.addon.isEconomyProvided()) { @@ -960,8 +1018,16 @@ public class EditChallengeGUI extends CommonGUI } case REWARD_COMMANDS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-command"); - description = this.challenge.getRewardCommands(); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-commands"); + description = new ArrayList<>(this.challenge.getRewardCommands().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-commands")); + + for (String command : this.challenge.getRewardCommands()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.command", + "[command]", command)); + } + icon = new ItemStack(Material.COMMAND_BLOCK); clickHandler = (panel, user, clickType, slot) -> { new StringListGUI(this.user, this.challenge.getRewardCommands(), lineLength, (status, value) -> { @@ -981,16 +1047,14 @@ public class EditChallengeGUI extends CommonGUI case REPEATABLE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.repeatable"); - - if (this.challenge.isRepeatable()) - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.enabled")); - } - else - { - description = Collections.singletonList(this.user.getTranslation("challenges.gui.admin.descriptions.disabled")); - } + name = this.user.getTranslation("challenges.gui.buttons.admin.repeatable"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.repeatable")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.challenge.isRepeatable() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); icon = new ItemStack(Material.LEVER); clickHandler = (panel, user, clickType, slot) -> { @@ -1004,11 +1068,12 @@ public class EditChallengeGUI extends CommonGUI } case REPEAT_COUNT: { - name = this.user.getTranslation("challenges.gui.admin.buttons.repeat-count"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.repeat-count", - "[value]", - Integer.toString(this.challenge.getMaxTimes()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.repeat-count"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.repeat-count")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challenge.getMaxTimes()))); + icon = new ItemStack(Material.COBBLESTONE_WALL); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challenge.getMaxTimes(), 0, (status, value) -> { @@ -1028,8 +1093,12 @@ public class EditChallengeGUI extends CommonGUI case REPEAT_REWARD_TEXT: { - name = this.user.getTranslation("challenges.gui.admin.buttons.repeat-reward-text"); - description = Collections.singletonList(this.challenge.getRepeatRewardText()); + name = this.user.getTranslation("challenges.gui.buttons.admin.repeat-reward-text"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.repeat-reward-text")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", "|" + this.challenge.getRepeatRewardText())); + icon = new ItemStack(Material.WRITTEN_BOOK); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -1048,15 +1117,30 @@ public class EditChallengeGUI extends CommonGUI } case REPEAT_REWARD_ITEM: { - List values = new ArrayList<>(this.challenge.getRepeatItemReward().size()); + name = this.user.getTranslation("challenges.gui.buttons.admin.repeat-reward-items"); + + description = new ArrayList<>(this.challenge.getRepeatItemReward().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.repeat-reward-items")); for (ItemStack itemStack : this.challenge.getRepeatItemReward()) { - values.add(itemStack.getType().name() + " " + itemStack.getAmount()); + description.add(this.user.getTranslation("challenges.gui.descriptions.item", + "[item]", itemStack.getType().name(), + "[count]", Integer.toString(itemStack.getAmount()))); + + if (itemStack.hasItemMeta() && itemStack.getEnchantments().isEmpty()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.item-meta", + "[meta]", itemStack.getItemMeta().toString())); + } + + for (Map.Entry entry : itemStack.getEnchantments().entrySet()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.item-enchant", + "[enchant]", entry.getKey().getKey().getKey(), "[level]", Integer.toString(entry.getValue()))); + } } - name = this.user.getTranslation("challenges.gui.admin.buttons.repeat-reward-items"); - description = values; icon = new ItemStack(Material.TRAPPED_CHEST); clickHandler = (panel, user, clickType, slot) -> { new ItemSwitchGUI(this.user, this.challenge.getRepeatItemReward(), lineLength, (status, value) -> { @@ -1075,11 +1159,12 @@ public class EditChallengeGUI extends CommonGUI } case REPEAT_REWARD_EXPERIENCE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.repeat-reward-exp"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.repeat-reward-exp", - "[value]", - Integer.toString(this.challenge.getRepeatExperienceReward()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.repeat-reward-experience"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.repeat-reward-experience")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challenge.getRepeatExperienceReward()))); + icon = new ItemStack(Material.GLASS_BOTTLE); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challenge.getRepeatExperienceReward(), 0, (status, value) -> { @@ -1098,11 +1183,11 @@ public class EditChallengeGUI extends CommonGUI } case REPEAT_REWARD_MONEY: { - name = this.user.getTranslation("challenges.gui.admin.buttons.repeat-reward-money"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.repeat-reward-money", - "[value]", - Integer.toString(this.challenge.getRepeatMoneyReward()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.repeat-reward-money"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.repeat-reward-money")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challenge.getRepeatMoneyReward()))); if (this.addon.isEconomyProvided()) { @@ -1134,8 +1219,16 @@ public class EditChallengeGUI extends CommonGUI } case REPEAT_REWARD_COMMANDS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.repeat-reward-command"); - description = this.challenge.getRepeatRewardCommands(); + name = this.user.getTranslation("challenges.gui.buttons.admin.repeat-reward-commands"); + description = new ArrayList<>(this.challenge.getRepeatRewardCommands().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.repeat-reward-commands")); + + for (String command : this.challenge.getRepeatRewardCommands()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.command", + "[command]", command)); + } + icon = new ItemStack(Material.COMMAND_BLOCK); clickHandler = (panel, user, clickType, slot) -> { new StringListGUI(this.user, this.challenge.getRepeatRewardCommands(), lineLength, (status, value) -> { diff --git a/src/main/java/world/bentobox/challenges/panel/admin/EditLevelGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/EditLevelGUI.java index a2300cc..f043b61 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/EditLevelGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/EditLevelGUI.java @@ -3,10 +3,12 @@ package world.bentobox.challenges.panel.admin; import org.bukkit.Material; import org.bukkit.World; +import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Map; import net.wesjd.anvilgui.AnvilGUI; import world.bentobox.bentobox.api.panels.PanelItem; @@ -80,7 +82,7 @@ public class EditLevelGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name( - this.user.getTranslation("challenges.gui.admin.edit-level-title")); + this.user.getTranslation("challenges.gui.title.admin.edit-level-title")); GuiUtils.fillBorder(panelBuilder); @@ -200,7 +202,7 @@ public class EditLevelGUI extends CommonGUI { ItemStack icon; String name; - List description; + String description; boolean glow; PanelItem.ClickHandler clickHandler; @@ -208,8 +210,8 @@ public class EditLevelGUI extends CommonGUI { case PROPERTIES: { - name = this.user.getTranslation("challenges.gui.admin.buttons.properties"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.properties"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.properties"); icon = new ItemStack(Material.CRAFTING_TABLE); clickHandler = (panel, user, clickType, slot) -> { this.currentMenuType = MenuType.PROPERTIES; @@ -222,8 +224,8 @@ public class EditLevelGUI extends CommonGUI } case CHALLENGES: { - name = this.user.getTranslation("challenges.gui.admin.buttons.challenges"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.challenges"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.challenges"); icon = new ItemStack(Material.RAIL); clickHandler = (panel, user, clickType, slot) -> { this.currentMenuType = MenuType.CHALLENGES; @@ -236,8 +238,8 @@ public class EditLevelGUI extends CommonGUI } case REWARDS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.rewards"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.rewards"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.rewards"); icon = new ItemStack(Material.DROPPER); clickHandler = (panel, user, clickType, slot) -> { this.currentMenuType = MenuType.REWARDS; @@ -305,8 +307,11 @@ public class EditLevelGUI extends CommonGUI { case NAME: { - name = this.user.getTranslation("challenges.gui.admin.buttons.name"); - description = Collections.singletonList(this.challengeLevel.getFriendlyName()); + name = this.user.getTranslation("challenges.gui.buttons.admin.name"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.name-level")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", this.challengeLevel.getFriendlyName())); icon = new ItemStack(Material.DROPPER); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -325,8 +330,9 @@ public class EditLevelGUI extends CommonGUI } case ICON: { - name = this.user.getTranslation("challenges.gui.admin.buttons.icon"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.icon"); + description = Collections.singletonList(this.user.getTranslation( + "challenges.gui.descriptions.admin.icon-challenge")); icon = this.challengeLevel.getIcon(); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -355,8 +361,11 @@ public class EditLevelGUI extends CommonGUI } case UNLOCK_MESSAGE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.description"); - description = Collections.singletonList(this.challengeLevel.getUnlockMessage()); + name = this.user.getTranslation("challenges.gui.buttons.admin.description"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.description")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", "|" + this.challengeLevel.getUnlockMessage())); icon = new ItemStack(Material.WRITABLE_BOOK); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -374,11 +383,11 @@ public class EditLevelGUI extends CommonGUI } case ORDER: { - name = this.user.getTranslation("challenges.gui.admin.buttons.order"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.order", - "[value]", - Integer.toString(this.challengeLevel.getOrder()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.order"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.order")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challengeLevel.getOrder()))); icon = new ItemStack(Material.DROPPER); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challengeLevel.getOrder(), -1, 54, (status, value) -> { @@ -397,11 +406,12 @@ public class EditLevelGUI extends CommonGUI } case WAIVER_AMOUNT: { - name = this.user.getTranslation("challenges.gui.admin.buttons.waiver-amount"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.waiver-amount", - "[value]", - Integer.toString(this.challengeLevel.getWaiverAmount()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.waiver-amount"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.waiver-amount")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challengeLevel.getWaiverAmount()))); + icon = new ItemStack(Material.REDSTONE_TORCH); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challengeLevel.getWaiverAmount(), 0, (status, value) -> { @@ -421,8 +431,11 @@ public class EditLevelGUI extends CommonGUI case REWARD_DESCRIPTION: { - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-text"); - description = Collections.singletonList(this.challengeLevel.getRewardText()); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-text"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-text-level")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", "|" + this.challengeLevel.getRewardText())); icon = new ItemStack(Material.WRITTEN_BOOK); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(this.addon.getPlugin(), @@ -440,15 +453,30 @@ public class EditLevelGUI extends CommonGUI } case REWARD_ITEM: { - List values = new ArrayList<>(this.challengeLevel.getRewardItems().size()); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-items"); + + description = new ArrayList<>(this.challengeLevel.getRewardItems().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-items")); for (ItemStack itemStack : this.challengeLevel.getRewardItems()) { - values.add(itemStack.getType().name() + " " + itemStack.getAmount()); + description.add(this.user.getTranslation("challenges.gui.descriptions.item", + "[item]", itemStack.getType().name(), + "[count]", Integer.toString(itemStack.getAmount()))); + + if (itemStack.hasItemMeta() && itemStack.getEnchantments().isEmpty()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.item-meta", + "[meta]", itemStack.getItemMeta().toString())); + } + + for (Map.Entry entry : itemStack.getEnchantments().entrySet()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.item-enchant", + "[enchant]", entry.getKey().getKey().getKey(), "[level]", Integer.toString(entry.getValue()))); + } } - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-items"); - description = values; icon = new ItemStack(Material.CHEST); clickHandler = (panel, user, clickType, slot) -> { new ItemSwitchGUI(this.user, this.challengeLevel.getRewardItems(), lineLength, (status, value) -> { @@ -467,11 +495,11 @@ public class EditLevelGUI extends CommonGUI } case REWARD_EXPERIENCE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-exp"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.reward-exp", - "[value]", - Integer.toString(this.challengeLevel.getRewardExperience()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-experience"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-experience")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challengeLevel.getRewardExperience()))); icon = new ItemStack(Material.EXPERIENCE_BOTTLE); clickHandler = (panel, user, clickType, slot) -> { new NumberGUI(this.user, this.challengeLevel.getRewardExperience(), 0, (status, value) -> { @@ -490,11 +518,11 @@ public class EditLevelGUI extends CommonGUI } case REWARD_MONEY: { - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-money"); - description = Collections.singletonList( - this.user.getTranslation("challenges.gui.admin.descriptions.reward-money", - "[value]", - Integer.toString(this.challengeLevel.getRewardMoney()))); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-money"); + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-money")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.challengeLevel.getRewardMoney()))); if (this.addon.isEconomyProvided()) { @@ -523,8 +551,16 @@ public class EditLevelGUI extends CommonGUI } case REWARD_COMMANDS: { - name = this.user.getTranslation("challenges.gui.admin.buttons.reward-command"); - description = this.challengeLevel.getRewardCommands(); + name = this.user.getTranslation("challenges.gui.buttons.admin.reward-commands"); + description = new ArrayList<>(this.challengeLevel.getRewardCommands().size() + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reward-commands")); + + for (String command : this.challengeLevel.getRewardCommands()) + { + description.add(this.user.getTranslation("challenges.gui.descriptions.command", + "[command]", command)); + } + icon = new ItemStack(Material.COMMAND_BLOCK); clickHandler = (panel, user, clickType, slot) -> { new StringListGUI(this.user, this.challengeLevel.getRewardCommands(), lineLength, (status, value) -> { @@ -544,8 +580,8 @@ public class EditLevelGUI extends CommonGUI case ADD_CHALLENGE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.add-challenge"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.add-challenge"); + description = Collections.singletonList(this.user.getTranslation("challenges.gui.descriptions.admin.add-challenge")); icon = new ItemStack(Material.WATER_BUCKET); clickHandler = (panel, user, clickType, slot) -> { ChallengesManager manager = this.addon.getChallengesManager(); @@ -570,8 +606,8 @@ public class EditLevelGUI extends CommonGUI } case REMOVE_CHALLENGE: { - name = this.user.getTranslation("challenges.gui.admin.buttons.remove-challenge"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.remove-challenge"); + description = Collections.singletonList(this.user.getTranslation("challenges.gui.descriptions.admin.remove-challenge")); icon = new ItemStack(Material.LAVA_BUCKET); clickHandler = (panel, user, clickType, slot) -> { ChallengesManager manager = this.addon.getChallengesManager(); diff --git a/src/main/java/world/bentobox/challenges/panel/admin/EditSettingsGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/EditSettingsGUI.java index a3d548c..fb79f70 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/EditSettingsGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/EditSettingsGUI.java @@ -4,6 +4,9 @@ package world.bentobox.challenges.panel.admin; import org.bukkit.Material; import org.bukkit.World; +import java.util.ArrayList; +import java.util.List; + import world.bentobox.bentobox.api.panels.builders.PanelBuilder; import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder; import world.bentobox.bentobox.api.user.User; @@ -60,15 +63,24 @@ public class EditSettingsGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name( - this.user.getTranslation("challenges.gui.admin.settings-title")); + this.user.getTranslation("challenges.gui.title.admin.settings-title")); final int lineLength = this.addon.getChallengesSettings().getLoreLineLength(); GuiUtils.fillBorder(panelBuilder); // resetChallenges + + List description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.reset-on-new")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.addon.getChallengesSettings().isResetChallenges() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); + panelBuilder.item(19, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.reset")). - description(GuiUtils.stringSplit(this.user.getTranslation("challenges.gui.admin.descriptions.reset"), lineLength)). + name(this.user.getTranslation("challenges.gui.buttons.admin.reset-on-new")). + description(GuiUtils.stringSplit(description, lineLength)). icon(Material.LAVA_BUCKET). clickHandler((panel, user1, clickType, i) -> { this.addon.getChallengesSettings().setResetChallenges( @@ -80,9 +92,17 @@ public class EditSettingsGUI extends CommonGUI build()); // broadcastMessages + description.clear(); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.broadcast")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.addon.getChallengesSettings().isBroadcastMessages() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); + panelBuilder.item(20, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.broadcast")). - description(GuiUtils.stringSplit(this.user.getTranslation("challenges.gui.admin.descriptions.broadcast"), lineLength)). + name(this.user.getTranslation("challenges.gui.buttons.admin.broadcast")). + description(GuiUtils.stringSplit(description, lineLength)). icon(Material.JUKEBOX). clickHandler((panel, user1, clickType, i) -> { this.addon.getChallengesSettings().setBroadcastMessages( @@ -94,9 +114,17 @@ public class EditSettingsGUI extends CommonGUI build()); // removeCompleteOneTimeChallenges + description.clear(); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.remove-completed")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.addon.getChallengesSettings().isRemoveCompleteOneTimeChallenges() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); + panelBuilder.item(21, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.remove-on-complete")). - description(GuiUtils.stringSplit(this.user.getTranslation("challenges.gui.admin.descriptions.remove-on-complete"), lineLength)). + name(this.user.getTranslation("challenges.gui.buttons.admin.remove-completed")). + description(GuiUtils.stringSplit(description, lineLength)). icon(Material.MAGMA_BLOCK). clickHandler((panel, user1, clickType, i) -> { this.addon.getChallengesSettings().setRemoveCompleteOneTimeChallenges( @@ -108,9 +136,17 @@ public class EditSettingsGUI extends CommonGUI build()); // addCompletedGlow + description.clear(); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.glow")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.addon.getChallengesSettings().isAddCompletedGlow() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); + panelBuilder.item(22, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.glow")). - description(GuiUtils.stringSplit(this.user.getTranslation("challenges.gui.admin.descriptions.glow"), lineLength)). + name(this.user.getTranslation("challenges.gui.buttons.admin.glow")). + description(GuiUtils.stringSplit(description, lineLength)). icon(Material.GLOWSTONE). clickHandler((panel, user1, clickType, i) -> { this.addon.getChallengesSettings().setAddCompletedGlow( @@ -122,9 +158,17 @@ public class EditSettingsGUI extends CommonGUI build()); // freeChallengesAtTheTop + description.clear(); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.free-at-top")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", + this.addon.getChallengesSettings().isAddCompletedGlow() ? + this.user.getTranslation("challenges.gui.descriptions.enabled") : + this.user.getTranslation("challenges.gui.descriptions.disabled"))); + panelBuilder.item(23, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.free-challenges")). - description(GuiUtils.stringSplit(this.user.getTranslation("challenges.gui.admin.descriptions.free-challenges"), lineLength)). + name(this.user.getTranslation("challenges.gui.buttons.admin.free-at-top")). + description(GuiUtils.stringSplit(description, lineLength)). icon(Material.FILLED_MAP). clickHandler((panel, user1, clickType, i) -> { this.addon.getChallengesSettings().setFreeChallengesFirst( @@ -136,9 +180,13 @@ public class EditSettingsGUI extends CommonGUI build()); // Lore line length - panelBuilder.item(23, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.lore-length")). - description(GuiUtils.stringSplit(this.user.getTranslation("challenges.gui.admin.descriptions.lore-length"), lineLength)). + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.line-length")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", Integer.toString(this.addon.getChallengesSettings().getLoreLineLength()))); + panelBuilder.item(24, new PanelItemBuilder(). + name(this.user.getTranslation("challenges.gui.buttons.admin.line-length")). + description(GuiUtils.stringSplit(description, lineLength)). icon(Material.ANVIL). clickHandler((panel, user1, clickType, i) -> { new NumberGUI(this.user, diff --git a/src/main/java/world/bentobox/challenges/panel/admin/ListChallengesGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/ListChallengesGUI.java index c669302..7b075c3 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/ListChallengesGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/ListChallengesGUI.java @@ -71,7 +71,7 @@ public class ListChallengesGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name( - this.user.getTranslation("challenges.gui.admin.choose-challenge-title")); + this.user.getTranslation("challenges.gui.title.admin.choose-challenge-title")); if (this.currentMode.equals(Mode.DELETE)) { diff --git a/src/main/java/world/bentobox/challenges/panel/admin/ListLevelsGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/ListLevelsGUI.java index 8ef9430..7bc9320 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/ListLevelsGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/ListLevelsGUI.java @@ -71,7 +71,7 @@ public class ListLevelsGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name( - this.user.getTranslation("challenges.gui.admin.choose-level-title")); + this.user.getTranslation("challenges.gui.title.admin.choose-level-title")); if (this.currentMode.equals(Mode.DELETE)) { diff --git a/src/main/java/world/bentobox/challenges/panel/admin/ListUsersGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/ListUsersGUI.java index bbd5a3d..e9267dd 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/ListUsersGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/ListUsersGUI.java @@ -114,7 +114,7 @@ public class ListUsersGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name( - this.user.getTranslation("challenges.gui.admin.choose-user-title")); + this.user.getTranslation("challenges.gui.title.admin.choose-user-title")); GuiUtils.fillBorder(panelBuilder); @@ -262,20 +262,18 @@ public class ListUsersGUI extends CommonGUI */ private PanelItem createToggleButton() { - List values = new ArrayList<>(ViewMode.values().length); - - for (int i = 0; i < ViewMode.values().length; i++) - { - values.add((this.modeIndex == i ? "&2" : "&c") + - this.user.getTranslation("challenges.gui.admin.descriptions." + - ViewMode.values()[i].name().toLowerCase())); - } + List description = new ArrayList<>(ViewMode.values().length + 1); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.toggle-user-list")); + description.add((ViewMode.ONLINE == ViewMode.values()[this.modeIndex] ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.admin.mode-online")); + description.add((ViewMode.WITH_ISLAND == ViewMode.values()[this.modeIndex] ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.admin.mode-in-world")); + description.add((ViewMode.IN_WORLD == ViewMode.values()[this.modeIndex] ? "&2" : "&c") + + this.user.getTranslation("challenges.gui.descriptions.admin.mode-with-island")); return new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.toggle-users", - "[value]", - this.user.getTranslation("challenges.gui.admin.descriptions." + ViewMode.values()[this.modeIndex].name().toLowerCase()))). - description(GuiUtils.stringSplit(values, this.addon.getChallengesSettings().getLoreLineLength())). + name(this.user.getTranslation("challenges.gui.buttons.admin.toggle-user-list")). + description(GuiUtils.stringSplit(description, this.addon.getChallengesSettings().getLoreLineLength())). icon(Material.STONE_BUTTON). clickHandler( (panel, user1, clickType, slot) -> { diff --git a/src/main/java/world/bentobox/challenges/panel/admin/ManageBlocksGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/ManageBlocksGUI.java index 28ec03d..f57e5c1 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/ManageBlocksGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/ManageBlocksGUI.java @@ -54,7 +54,7 @@ public class ManageBlocksGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user). - name(this.user.getTranslation("challenges.gui.admin.manage-blocks")); + name(this.user.getTranslation("challenges.gui.title.admin.manage-blocks")); // Create nice border. GuiUtils.fillBorder(panelBuilder); @@ -116,7 +116,7 @@ public class ManageBlocksGUI extends CommonGUI switch (button) { case ADD: - builder.name(this.user.getTranslation("challenges.gui.button.add")); + builder.name(this.user.getTranslation("challenges.gui.buttons.admin.add")); builder.icon(Material.BUCKET); builder.clickHandler((panel, user1, clickType, slot) -> { @@ -133,7 +133,8 @@ public class ManageBlocksGUI extends CommonGUI }); break; case REMOVE: - builder.name(this.user.getTranslation("challenges.gui.button.remove-selected")); + builder.name(this.user.getTranslation("challenges.gui.buttons.admin.remove-selected")); + builder.description(this.user.getTranslation("challenges.gui.descriptions.admin.remove-selected")); builder.icon(Material.LAVA_BUCKET); builder.clickHandler((panel, user1, clickType, slot) -> { this.materialMap.keySet().removeAll(this.selectedMaterials); @@ -158,6 +159,8 @@ public class ManageBlocksGUI extends CommonGUI return new PanelItemBuilder(). name(WordUtils.capitalize(material.name().toLowerCase().replace("_", " "))). icon(GuiUtils.getMaterialItem(material, this.materialMap.get(material))). + description(this.selectedMaterials.contains(material) ? + this.user.getTranslation("challenges.gui.descriptions.admin.selected") : ""). clickHandler((panel, user1, clickType, slot) -> { // On right click change which entities are selected for deletion. if (clickType.isRightClick()) diff --git a/src/main/java/world/bentobox/challenges/panel/admin/ManageEntitiesGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/ManageEntitiesGUI.java index d244984..4cc1616 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/ManageEntitiesGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/ManageEntitiesGUI.java @@ -53,7 +53,7 @@ public class ManageEntitiesGUI extends CommonGUI public void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user). - name(this.user.getTranslation("challenges.gui.admin.edit-entities")); + name(this.user.getTranslation("challenges.gui.title.admin.manage-entities")); // create border GuiUtils.fillBorder(panelBuilder); @@ -116,7 +116,7 @@ public class ManageEntitiesGUI extends CommonGUI switch (button) { case ADD: - builder.name(this.user.getTranslation("challenges.gui.button.add")); + builder.name(this.user.getTranslation("challenges.gui.buttons.admin.add")); builder.icon(Material.BUCKET); builder.clickHandler((panel, user1, clickType, slot) -> { new SelectEntityGUI(this.user, Collections.emptySet(), this.asEggs, (status, entity) -> { @@ -135,7 +135,8 @@ public class ManageEntitiesGUI extends CommonGUI }); break; case REMOVE: - builder.name(this.user.getTranslation("challenges.gui.button.remove-selected")); + builder.name(this.user.getTranslation("challenges.gui.buttons.admin.remove-selected")); + builder.description(this.user.getTranslation("challenges.gui.descriptions.admin.remove-selected")); builder.icon(Material.LAVA_BUCKET); builder.clickHandler((panel, user1, clickType, slot) -> { this.requiredEntities.keySet().removeAll(this.selectedEntities); @@ -145,7 +146,8 @@ public class ManageEntitiesGUI extends CommonGUI }); break; case SWITCH: - builder.name(this.user.getTranslation("challenges.gui.button.show-eggs")); + builder.name(this.user.getTranslation("challenges.gui.buttons.admin.show-eggs")); + builder.description(this.user.getTranslation("challenges.gui.descriptions.admin.show-eggs")); builder.icon(this.asEggs ? Material.EGG : Material.PLAYER_HEAD); builder.clickHandler((panel, user1, clickType, slot) -> { this.asEggs = !this.asEggs; @@ -168,6 +170,8 @@ public class ManageEntitiesGUI extends CommonGUI { return new PanelItemBuilder(). name(WordUtils.capitalize(entity.name().toLowerCase().replace("_", " "))). + description(this.selectedEntities.contains(entity) ? + this.user.getTranslation("challenges.gui.descriptions.admin.selected") : ""). icon(this.asEggs ? GuiUtils.getEntityEgg(entity, this.requiredEntities.get(entity)) : GuiUtils.getEntityHead(entity, this.requiredEntities.get(entity))). diff --git a/src/main/java/world/bentobox/challenges/panel/user/ChallengesGUI.java b/src/main/java/world/bentobox/challenges/panel/user/ChallengesGUI.java index 2e4474e..8cd1aaa 100644 --- a/src/main/java/world/bentobox/challenges/panel/user/ChallengesGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/user/ChallengesGUI.java @@ -3,9 +3,11 @@ package world.bentobox.challenges.panel.user; import org.bukkit.Material; import org.bukkit.World; +import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; import java.util.List; +import java.util.Map; import world.bentobox.bentobox.api.panels.PanelItem; import world.bentobox.bentobox.api.panels.builders.PanelBuilder; @@ -82,7 +84,7 @@ public class ChallengesGUI extends CommonGUI } PanelBuilder panelBuilder = new PanelBuilder().user(this.user). - name(this.user.getTranslation("challenges.gui.title")); + name(this.user.getTranslation("challenges.gui.title.challenges")); // TODO: get last completed level. @@ -372,14 +374,14 @@ public class ChallengesGUI extends CommonGUI { List result = new ArrayList<>(); - result.add(this.user.getTranslation("challenges.level", + result.add(this.user.getTranslation("challenges.gui.challenge-description.level", "[level]", this.challengesManager.getLevel(challenge).getFriendlyName())); boolean completed = this.challengesManager.isChallengeComplete(this.user, challenge); if (completed) { - result.add(this.user.getTranslation("challenges.complete")); + result.add(this.user.getTranslation("challenges.gui.challenge-description.completed")); } if (challenge.isRepeatable()) @@ -391,7 +393,8 @@ public class ChallengesGUI extends CommonGUI { if (doneTimes < maxTimes) { - result.add(this.user.getTranslation("challenges.completed-times", + result.add(this.user.getTranslation( + "challenges.gui.challenge-description.completed-times-of", "[donetimes]", String.valueOf(doneTimes), "[maxtimes]", String.valueOf(maxTimes))); @@ -400,14 +403,14 @@ public class ChallengesGUI extends CommonGUI } else { - result.add(this.user.getTranslation("challenges.maxed-reached", + result.add(this.user.getTranslation("challenges.gui.challenge-description.maxed-reached", "[donetimes]", String.valueOf(doneTimes), "[maxtimes]", String.valueOf(maxTimes))); } } else { - result.add(this.user.getTranslation("challenges.completed-times", + result.add(this.user.getTranslation("challenges.gui.challenge-description.completed-times", "[donetimes]", String.valueOf(doneTimes))); // Change value to false, as max count not reached. @@ -423,28 +426,31 @@ public class ChallengesGUI extends CommonGUI { if (challenge.isTakeItems()) { - result.add(this.user.getTranslation("challenges.item-take-warning")); + result.add(this.user.getTranslation( + "challenges.gui.challenge-description.warning-items-take")); } } else if (challenge.getChallengeType().equals(Challenge.ChallengeType.ISLAND)) { - result.add(this.user.getTranslation("challenges.items-closeby")); + result.add(this.user.getTranslation("challenges.gui.challenge-description.objects-close-by")); if (challenge.isRemoveEntities() && !challenge.getRequiredEntities().isEmpty()) { - result.add(this.user.getTranslation("challenges.entities-kill-warning")); + result.add(this.user.getTranslation( + "challenges.gui.challenge-description.warning-entities-kill")); } if (challenge.isRemoveBlocks() && !challenge.getRequiredBlocks().isEmpty()) { - result.add(this.user.getTranslation("challenges.blocks-take-warning")); + result.add(this.user.getTranslation( + "challenges.gui.challenge-description.warning-blocks-remove")); } } } if (completed) { - result.add(this.user.getTranslation("challenges.not-repeatable")); + result.add(this.user.getTranslation("challenges.gui.challenge-description.not-repeatable")); } else { @@ -467,18 +473,24 @@ public class ChallengesGUI extends CommonGUI String rewardText; double rewardMoney; int rewardExperience; + List rewardItems; + List rewardCommands; if (!this.challengesManager.isChallengeComplete(this.user, challenge)) { rewardText = challenge.getRewardText(); rewardMoney = challenge.getRewardMoney(); rewardExperience = challenge.getRewardExperience(); + rewardItems = challenge.getRewardItems(); + rewardCommands = challenge.getRewardCommands(); } else { rewardText = challenge.getRepeatRewardText(); rewardMoney = challenge.getRepeatMoneyReward(); rewardExperience = challenge.getRepeatExperienceReward(); + rewardItems = challenge.getRepeatItemReward(); + rewardCommands = challenge.getRepeatRewardCommands(); } List result = new ArrayList<>(); @@ -489,15 +501,48 @@ public class ChallengesGUI extends CommonGUI // Add message about reward XP if (rewardExperience > 0) { - result.add(this.user.getTranslation("challenges.exp-reward", - "[reward]", Integer.toString(rewardExperience))); + result.add(this.user.getTranslation("challenges.gui.challenge-description.experience-reward", + "[value]", Integer.toString(rewardExperience))); } // Add message about reward money if (this.addon.getPlugin().getSettings().isUseEconomy() && rewardMoney > 0) { - result.add(this.user.getTranslation("challenges.money-reward", - "[reward]", Double.toString(rewardMoney))); + result.add(this.user.getTranslation("challenges.gui.challenge-description.money-reward", + "[value]", Double.toString(rewardMoney))); + } + + // Add message about reward items + if (!rewardItems.isEmpty()) + { + for (ItemStack itemStack : rewardItems) + { + result.add(this.user.getTranslation("challenges.gui.descriptions.item", + "[item]", itemStack.getType().name(), + "[count]", Integer.toString(itemStack.getAmount()))); + + if (itemStack.hasItemMeta() && itemStack.getEnchantments().isEmpty()) + { + result.add(this.user.getTranslation("challenges.gui.descriptions.item-meta", + "[meta]", itemStack.getItemMeta().toString())); + } + + for (Map.Entry entry : itemStack.getEnchantments().entrySet()) + { + result.add(this.user.getTranslation("challenges.gui.descriptions.item-enchant", + "[enchant]", entry.getKey().getKey().getKey(), "[level]", Integer.toString(entry.getValue()))); + } + } + } + + // Add message about reward commands + if (!rewardCommands.isEmpty()) + { + for (String command : rewardCommands) + { + result.add(this.user.getTranslation("challenges.gui.descriptions.command", + "[command]", command.replace("[player]", this.user.getName()).replace("[SELF]", ""))); + } } return result; @@ -525,7 +570,7 @@ public class ChallengesGUI extends CommonGUI { icon = level.getLevel().getIcon(); description = GuiUtils.stringSplit( - this.user.getTranslation("challenges.navigation", "[level]", name), + this.user.getTranslation("challenges.gui.descriptions.level-unlocked", "[level]", name), this.addon.getChallengesSettings().getLoreLineLength()); clickHandler = (panel, user1, clickType, slot) -> { this.lastSelectedLevel = level; @@ -544,9 +589,9 @@ public class ChallengesGUI extends CommonGUI icon = new ItemStack(Material.BOOK); description = GuiUtils.stringSplit( - this.user.getTranslation("challenges.to-complete", - "[challengesToDo]", Integer.toString(level.getNumberOfChallengesStillToDo()), - "[thisLevel]", level.getPreviousLevel().getFriendlyName()), + this.user.getTranslation("challenges.gui.descriptions.level-locked", + "[count]", Integer.toString(level.getNumberOfChallengesStillToDo()), + "[level]", level.getPreviousLevel().getFriendlyName()), this.addon.getChallengesSettings().getLoreLineLength()); clickHandler = null; diff --git a/src/main/java/world/bentobox/challenges/panel/util/ConfirmationGUI.java b/src/main/java/world/bentobox/challenges/panel/util/ConfirmationGUI.java index 3d36baf..73950c1 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/ConfirmationGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/ConfirmationGUI.java @@ -37,7 +37,7 @@ public class ConfirmationGUI */ public void build() { - PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.admin.confirm-title")); + PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.title.admin.confirm-title")); GuiUtils.fillBorder(panelBuilder, Material.BLUE_STAINED_GLASS_PANE); diff --git a/src/main/java/world/bentobox/challenges/panel/util/ItemSwitchGUI.java b/src/main/java/world/bentobox/challenges/panel/util/ItemSwitchGUI.java index 7fc7c9e..6507bfc 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/ItemSwitchGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/ItemSwitchGUI.java @@ -37,7 +37,7 @@ public class ItemSwitchGUI */ private void build() { - PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.change-items")); + PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.title.admin.manage-items")); // Size of inventory that user can set via GUI. panelBuilder.size(45); @@ -78,7 +78,7 @@ public class ItemSwitchGUI { case SAVE: { - name = this.user.getTranslation("challenges.gui.buttons.save"); + name = this.user.getTranslation("challenges.gui.buttons.admin.save"); description = Collections.emptyList(); icon = new ItemStack(Material.COMMAND_BLOCK); clickHandler = (panel, user, clickType, slot) -> { @@ -104,7 +104,7 @@ public class ItemSwitchGUI } case CANCEL: { - name = this.user.getTranslation("challenges.gui.buttons.cancel"); + name = this.user.getTranslation("challenges.gui.buttons.admin.cancel"); description = Collections.emptyList(); icon = new ItemStack(Material.IRON_DOOR); clickHandler = (panel, user, clickType, slot) -> { diff --git a/src/main/java/world/bentobox/challenges/panel/util/NumberGUI.java b/src/main/java/world/bentobox/challenges/panel/util/NumberGUI.java index 1ef760a..9e5efa2 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/NumberGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/NumberGUI.java @@ -4,7 +4,6 @@ package world.bentobox.challenges.panel.util; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import java.util.Collections; -import java.util.List; import java.util.function.BiConsumer; import net.wesjd.anvilgui.AnvilGUI; @@ -55,7 +54,7 @@ public class NumberGUI */ private void build() { - PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.edit-number-title")); + PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.title.admin.manage-numbers")); GuiUtils.fillBorder(panelBuilder); @@ -105,7 +104,7 @@ public class NumberGUI { ItemStack icon; String name; - List description; + String description; PanelItem.ClickHandler clickHandler; boolean glow; @@ -113,8 +112,8 @@ public class NumberGUI { case SAVE: { - name = this.user.getTranslation("challenges.gui.buttons.save"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.save"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.save"); icon = new ItemStack(Material.COMMAND_BLOCK); clickHandler = (panel, user, clickType, slot) -> { this.consumer.accept(true, this.value); @@ -125,8 +124,8 @@ public class NumberGUI } case CANCEL: { - name = this.user.getTranslation("challenges.gui.buttons.cancel"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.cancel"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.cancel"); icon = new ItemStack(Material.OAK_DOOR); clickHandler = (panel, user, clickType, slot) -> { this.consumer.accept(false, this.value); @@ -137,8 +136,8 @@ public class NumberGUI } case INPUT: { - name = this.user.getTranslation("challenges.gui.buttons.input"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.input"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.input"); icon = new ItemStack(Material.ANVIL); clickHandler = (panel, user, clickType, slot) -> { new AnvilGUI(BentoBox.getInstance(), @@ -151,7 +150,7 @@ public class NumberGUI if (this.value > this.maxValue || this.value < this.minValue) { - this.user.sendMessage("challenges.error.not-valid-integer", + this.user.sendMessage("challenges.errors.not-valid-integer", "[value]", reply, "[min]", Integer.toString(this.minValue), "[max]", Integer.toString(this.maxValue)); @@ -164,7 +163,7 @@ public class NumberGUI catch (Exception e) { reply = Integer.toString(this.value); - this.user.sendMessage("challenges.error.not-a-integer", "[value]", reply); + this.user.sendMessage("challenges.errors.not-a-integer", "[value]", reply); } return reply; @@ -177,8 +176,8 @@ public class NumberGUI } case VALUE: { - name = this.user.getTranslation("challenges.gui.buttons.value"); - description = Collections.singletonList(Integer.toString(this.value)); + name = this.user.getTranslation("challenges.gui.buttons.admin.value"); + description = this.user.getTranslation("challenges.gui.descriptions.current-value", "[value]", Integer.toString(this.value)); icon = new ItemStack(Material.PAPER); clickHandler = (panel, user, clickType, slot) -> true; glow = false; @@ -186,8 +185,8 @@ public class NumberGUI } case SET: { - name = this.user.getTranslation("challenges.gui.buttons.set"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.set"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.set"); icon = new ItemStack(Material.WHITE_STAINED_GLASS_PANE); clickHandler = (panel, user, clickType, slot) -> { this.currentOperation = Button.SET; @@ -199,8 +198,8 @@ public class NumberGUI } case INCREASE: { - name = this.user.getTranslation("challenges.gui.buttons.increase"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.increase"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.increase"); icon = new ItemStack(Material.GREEN_STAINED_GLASS_PANE); clickHandler = (panel, user, clickType, slot) -> { this.currentOperation = Button.INCREASE; @@ -212,8 +211,8 @@ public class NumberGUI } case REDUCE: { - name = this.user.getTranslation("challenges.gui.buttons.reduce"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.reduce"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.reduce"); icon = new ItemStack(Material.RED_STAINED_GLASS_PANE); clickHandler = (panel, user, clickType, slot) -> { this.currentOperation = Button.REDUCE; @@ -225,8 +224,8 @@ public class NumberGUI } case MULTIPLY: { - name = this.user.getTranslation("challenges.gui.buttons.multiply"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.multiply"); + description = this.user.getTranslation("challenges.gui.descriptions.admin.multiply"); icon = new ItemStack(Material.BLUE_STAINED_GLASS_PANE); clickHandler = (panel, user, clickType, slot) -> { this.currentOperation = Button.MULTIPLY; @@ -257,14 +256,14 @@ public class NumberGUI { case SET: { - itemBuilder.name(this.user.getTranslation("biomes.gui.buttons.set","[number]", Integer.toString(number))); + itemBuilder.name(this.user.getTranslation("challenges.gui.buttons.admin.number","[number]", Integer.toString(number))); itemBuilder.icon(Material.WHITE_STAINED_GLASS_PANE); itemBuilder.clickHandler((panel, user1, clickType, i) -> { this.value = number; if (this.value > this.maxValue) { - this.user.sendMessage("challenges.error.not-valid-integer", + this.user.sendMessage("challenges.errors.not-valid-integer", "[value]", Integer.toString(this.value), "[min]", Integer.toString(this.minValue), "[max]", Integer.toString(this.maxValue)); @@ -274,7 +273,7 @@ public class NumberGUI if (this.value < this.minValue) { - this.user.sendMessage("challenges.error.not-valid-integer", + this.user.sendMessage("challenges.errors.not-valid-integer", "[value]", Integer.toString(this.value), "[min]", Integer.toString(this.minValue), "[max]", Integer.toString(this.maxValue)); @@ -290,14 +289,14 @@ public class NumberGUI } case INCREASE: { - itemBuilder.name(this.user.getTranslation("biomes.gui.buttons.increase","[number]", Integer.toString(number))); + itemBuilder.name(this.user.getTranslation("challenges.gui.buttons.admin.number","[number]", Integer.toString(number))); itemBuilder.icon(Material.GREEN_STAINED_GLASS_PANE); itemBuilder.clickHandler((panel, user1, clickType, i) -> { this.value += number; if (this.value > this.maxValue) { - this.user.sendMessage("challenges.error.not-valid-integer", + this.user.sendMessage("challenges.errors.not-valid-integer", "[value]", Integer.toString(this.value), "[min]", Integer.toString(this.minValue), "[max]", Integer.toString(this.maxValue)); @@ -313,14 +312,14 @@ public class NumberGUI } case REDUCE: { - itemBuilder.name(this.user.getTranslation("biomes.gui.buttons.reduce","[number]", Integer.toString(number))); + itemBuilder.name(this.user.getTranslation("challenges.gui.buttons.admin.number","[number]", Integer.toString(number))); itemBuilder.icon(Material.RED_STAINED_GLASS_PANE); itemBuilder.clickHandler((panel, user1, clickType, i) -> { this.value -= number; if (this.value < this.minValue) { - this.user.sendMessage("challenges.error.not-valid-integer", + this.user.sendMessage("challenges.errors.not-valid-integer", "[value]", Integer.toString(this.value), "[min]", Integer.toString(this.minValue), "[max]", Integer.toString(this.maxValue)); @@ -336,14 +335,14 @@ public class NumberGUI } case MULTIPLY: { - itemBuilder.name(this.user.getTranslation("biomes.gui.buttons.multiply","[number]", Integer.toString(number))); + itemBuilder.name(this.user.getTranslation("challenges.gui.buttons.admin.number","[number]", Integer.toString(number))); itemBuilder.icon(Material.BLUE_STAINED_GLASS_PANE); itemBuilder.clickHandler((panel, user1, clickType, i) -> { this.value *= number; if (this.value > this.maxValue) { - this.user.sendMessage("challenges.error.not-valid-integer", + this.user.sendMessage("challenges.errors.not-valid-integer", "[value]", Integer.toString(this.value), "[min]", Integer.toString(this.minValue), "[max]", Integer.toString(this.maxValue)); diff --git a/src/main/java/world/bentobox/challenges/panel/util/SelectBlocksGUI.java b/src/main/java/world/bentobox/challenges/panel/util/SelectBlocksGUI.java index 4870d04..1ac4f5f 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/SelectBlocksGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/SelectBlocksGUI.java @@ -71,7 +71,7 @@ public class SelectBlocksGUI public void build(int pageIndex) { PanelBuilder panelBuilder = new PanelBuilder().user(this.user). - name(this.user.getTranslation("challenges.gui.admin.select-block")); + name(this.user.getTranslation("challenges.gui.title.admin.select-block")); GuiUtils.fillBorder(panelBuilder, Material.BLUE_STAINED_GLASS_PANE); @@ -110,7 +110,7 @@ public class SelectBlocksGUI panelBuilder.item(4, new PanelItemBuilder(). icon(Material.RED_STAINED_GLASS_PANE). - name(this.user.getTranslation("challenges.gui.buttons.cancel")). + name(this.user.getTranslation("challenges.gui.buttons.admin.cancel")). clickHandler( (panel, user1, clickType, slot) -> { this.consumer.accept(false, null); return true; diff --git a/src/main/java/world/bentobox/challenges/panel/util/SelectChallengeGUI.java b/src/main/java/world/bentobox/challenges/panel/util/SelectChallengeGUI.java index 94da443..4664b12 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/SelectChallengeGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/SelectChallengeGUI.java @@ -34,7 +34,7 @@ public class SelectChallengeGUI */ private void build(int pageIndex) { - PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.choose-challenge-title")); + PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.title.admin.select-challenge")); GuiUtils.fillBorder(panelBuilder, Material.BLUE_STAINED_GLASS_PANE); diff --git a/src/main/java/world/bentobox/challenges/panel/util/SelectEntityGUI.java b/src/main/java/world/bentobox/challenges/panel/util/SelectEntityGUI.java index 31114c3..295ef21 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/SelectEntityGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/SelectEntityGUI.java @@ -59,7 +59,7 @@ public class SelectEntityGUI */ private void build(int pageIndex) { - PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.choose-entity-title")); + PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.title.admin.select-entity")); GuiUtils.fillBorder(panelBuilder, Material.BLUE_STAINED_GLASS_PANE); @@ -84,7 +84,7 @@ public class SelectEntityGUI panelBuilder.item(4, new PanelItemBuilder(). icon(Material.RED_STAINED_GLASS_PANE). - name(this.user.getTranslation("challenges.gui.buttons.cancel")). + name(this.user.getTranslation("challenges.gui.buttons.admin.cancel")). clickHandler( (panel, user1, clickType, slot) -> { this.consumer.accept(false, null); return true; diff --git a/src/main/java/world/bentobox/challenges/panel/util/SelectEnvironmentGUI.java b/src/main/java/world/bentobox/challenges/panel/util/SelectEnvironmentGUI.java index a0a42e8..313f103 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/SelectEnvironmentGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/SelectEnvironmentGUI.java @@ -34,12 +34,12 @@ public class SelectEnvironmentGUI */ private void build() { - PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.admin.environment-title")); + PanelBuilder panelBuilder = new PanelBuilder().user(this.user).name(this.user.getTranslation("challenges.gui.title.admin.toggle-environment")); GuiUtils.fillBorder(panelBuilder, Material.BLUE_STAINED_GLASS_PANE); panelBuilder.item(3, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.save")). + name(this.user.getTranslation("challenges.gui.buttons.admin.save")). icon(Material.GREEN_STAINED_GLASS_PANE). clickHandler((panel, user1, clickType, index) -> { this.consumer.accept(true, this.values); @@ -48,7 +48,7 @@ public class SelectEnvironmentGUI build()); panelBuilder.item(5, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.cancel")). + name(this.user.getTranslation("challenges.gui.buttons.admin.cancel")). icon(Material.RED_STAINED_GLASS_PANE). clickHandler((panel, user1, clickType, i) -> { this.consumer.accept(false, Collections.emptySet()); @@ -57,7 +57,7 @@ public class SelectEnvironmentGUI build()); panelBuilder.item(20, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.nether")). + name(World.Environment.NETHER.name()). icon(Material.NETHERRACK). clickHandler((panel, user1, clickType, i) -> { if (this.values.contains(World.Environment.NETHER)) @@ -75,7 +75,7 @@ public class SelectEnvironmentGUI glow(this.values.contains(World.Environment.NETHER)). build()); panelBuilder.item(22, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.normal")). + name(World.Environment.NORMAL.name()). icon(Material.DIRT). clickHandler((panel, user1, clickType, i) -> { if (this.values.contains(World.Environment.NORMAL)) @@ -93,7 +93,7 @@ public class SelectEnvironmentGUI glow(this.values.contains(World.Environment.NORMAL)). build()); panelBuilder.item(24, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.end")). + name(World.Environment.THE_END.name()). icon(Material.END_STONE). clickHandler((panel, user1, clickType, i) -> { if (this.values.contains(World.Environment.THE_END)) @@ -113,7 +113,7 @@ public class SelectEnvironmentGUI panelBuilder.item(44, new PanelItemBuilder(). - name(this.user.getTranslation("challenges.gui.admin.buttons.return")). + name(this.user.getTranslation("challenges.gui.buttons.return")). icon(Material.OAK_DOOR). clickHandler((panel, user1, clickType, i) -> { this.consumer.accept(false, Collections.emptySet()); diff --git a/src/main/java/world/bentobox/challenges/panel/util/StringListGUI.java b/src/main/java/world/bentobox/challenges/panel/util/StringListGUI.java index 3ea4358..b634401 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/StringListGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/StringListGUI.java @@ -55,7 +55,7 @@ public class StringListGUI private void build() { PanelBuilder panelBuilder = new PanelBuilder().user(this.user). - name(this.user.getTranslation("challenges.gui.text-edit-title")); + name(this.user.getTranslation("challenges.gui.title.admin.edit-text-fields")); GuiUtils.fillBorder(panelBuilder, Material.BLACK_STAINED_GLASS_PANE); @@ -101,8 +101,8 @@ public class StringListGUI { case SAVE: { - name = this.user.getTranslation("challenges.gui.buttons.save"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.save"); + description = Collections.singletonList(this.user.getTranslation("challenges.gui.descriptions.admin.save")); icon = new ItemStack(Material.GREEN_STAINED_GLASS_PANE); clickHandler = (panel, user, clickType, slot) -> { this.consumer.accept(true, this.value); @@ -113,8 +113,8 @@ public class StringListGUI } case CANCEL: { - name = this.user.getTranslation("challenges.gui.buttons.cancel"); - description = Collections.emptyList(); + name = this.user.getTranslation("challenges.gui.buttons.admin.cancel"); + description = Collections.singletonList(this.user.getTranslation("challenges.gui.descriptions.admin.cancel")); icon = new ItemStack(Material.OAK_DOOR); clickHandler = (panel, user, clickType, slot) -> { this.consumer.accept(false, this.value); @@ -125,15 +125,17 @@ public class StringListGUI } case VALUE: { - name = this.user.getTranslation("challenges.gui.buttons.value"); - description = this.value; + name = this.user.getTranslation("challenges.gui.buttons.admin.value"); + description = new ArrayList<>(); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", "[value]", "")); + description.addAll(this.value); icon = new ItemStack(Material.PAPER); clickHandler = (panel, user, clickType, slot) -> true; break; } case ADD: { - name = this.user.getTranslation("challenges.gui.buttons.add"); + name = this.user.getTranslation("challenges.gui.buttons.admin.add"); description = Collections.emptyList(); icon = new ItemStack(Material.WHITE_STAINED_GLASS_PANE); clickHandler = (panel, user, clickType, slot) -> { @@ -151,7 +153,7 @@ public class StringListGUI } case CLEAR: { - name = this.user.getTranslation("challenges.gui.buttons.clear"); + name = this.user.getTranslation("challenges.gui.buttons.admin.clear"); description = Collections.emptyList(); icon = new ItemStack(Material.RED_STAINED_GLASS_PANE); clickHandler = (panel, user, clickType, slot) -> { @@ -163,7 +165,7 @@ public class StringListGUI } case REMOVE: { - name = this.user.getTranslation("challenges.gui.buttons.remove"); + name = this.user.getTranslation("challenges.gui.buttons.admin.remove-empty"); description = Collections.emptyList(); icon = new ItemStack(Material.BLUE_STAINED_GLASS_PANE); clickHandler = (panel, user, clickType, slot) -> { diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 6339716..92e4577 100755 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -7,216 +7,281 @@ # Tastybento: maintainer challenges: - admin: - challenge-created: '[challenge] created!' - complete: - description: Mark challenge complete - parameters: - unknown-challenge: '&cUnknown challenge' - create: - description: '&6Collect:' - description-item-color: '&B' - inventory: - description: create an inventory challenge - parameters: '[challenge name]' - surrounding: - description: create a surrounding challenge - hit-things: Hit things to add them to the list of things required. Right click when done. - parameters: '[challenge name]' - description: challenges admin - error: - no-name: You must include a challenge name - gui-title: '&aChallenges Admin' - import: - add: 'Adding new challenge: [object]' - description: import challenges from challenges.yml - imported: Imported '[challenge]' - levels: 'Importing levels: [levels]' - no-file: '&cCould not find challenges.yml file to import!' - no-levels: 'Warning: No levels defined in challenges.yml' - no-load: '&cError: Could not load challenges.yml. [message]' - number: Imported [number] challenges - overwriting: Overwriting '[challenge]' - parameters: '[overwrite]' - skipping: '''[challenge]'' already exists - skipping' - parameters: '' - reload: - description: reload challenges from the database - parameters: '' - reset: - description: Reset challenge to 0 times / incomplete - parameters: - seticon: - description: sets the challenge icon to inhand item - error: - no-such-challenge: '&cNo such challenge name' - parameters: '[challenge name]' - you-added: You added one [thing] to the challenge - blocks-take-warning: Blocks will be removed. - challenge: - format: '[description]' - complete: '&BComplete' - completechallenge: - challange-completed: 'Challenge: [challengename] has been completed for [name]' - completed-times: Completed [donetimes] out of [maxtimes] - description: Open the challenges menu - entities-kill-warning: Entities will be killed. - error: - could-not-save: '&cCould not save the challenge!' - island-level: '&cYour island must be level [number] to complete this challenge!' - items-not-there: '&cAll required items must be close to you on your island!' - no-items-clicked: '&cYou did not click on anything. Cancelling.' - not-close-enough: '&cYou must be standing within [number] blocks of all required - items.' - not-enough-items: '&cYou do not have enough [items] to complete this challenge!' - not-on-island: '&cYou must be on your island to do that!' - reward-problem: '&cThere was a problem giving your reward. Ask Admin to check - log!' - you-still-need: '&cYou still need [amount] x [item]' - not-deployed: '&cChallenge is not deployed.' - errors: - challenge-level-not-available: You have not unlocked level to complete this challenge. - unique-id: Unique ID [id] is already taken. Choose different. - wrong-environment: You are in wrong environment! - wrong-icon: Material [icon] is not recognized - exp-reward: '&6Exp reward: [reward]' - first-time-rewards: '&6First time reward(s)' - gui: + commands: admin: - buttons: - add-challenge: Create Challenge - add-level: Create Level - blocks: Blocks - broadcast: Broadcast Messages - challenges: Challenges - complete: Complete - delete-challenge: Delete Challenge - delete-level: Delete Level - deployed: Deployment status - description: Description - edit-challenge: Edit Challenge - edit-level: Edit Level - entities: Entities - environment: Environment - free-challenges: Free Challenges Position - glow: Completion Glowing - icon: Icon - name: Name - order: Order Number - permissions: Permissions - properties: Properties - remove-blocks: Remove Blocks - remove-challenge: Remove Challenge - remove-entities: Remove Entities - remove-exp: Take Experience - remove-items: Remove items - remove-money: Remove Money - remove-on-complete: Remove on completion - repeat-count: Repeat Count - repeat-reward-command: Repeat Reward Command - repeat-reward-exp: Repeat Reward Experience - repeat-reward-items: Repeat Reward Items - repeat-reward-money: Repeat Reward Money - repeat-reward-text: Repeat Reward Text - repeatable: Repeatable - required-exp: Required Experience - required-items: Required items - required-level: Required Island Level - required-money: Required Money - requirements: Requirements - reset: Reset - reward-command: Reward Command - reward-exp: Reward Experience - reward-items: Reward Items - reward-money: Reward Money - reward-text: Reward Text - rewards: Rewards - search-radius: Search radius - settings: Settings - toggle-users: Choose players - type: 'Challenge Type: [value]' - waiver-amount: Waiver Amount - import: Import from ASkyBlock Challenges - backward: Import from Older ChallengesAddon - choose-challenge-title: Challenges List - choose-level-title: Levels List - choose-user-title: Users List - descriptions: - broadcast: Broadcast 1st time challenge completion messages to all players. - disabled: disabled - enabled: enabled - free-challenges: This indicate if free challenges must be at the start (true) or at the end (false) of list. - glow: Add enchanted glow to completed challenges - in_world: In World - inventory: This type of challenges allows to define inventory item requirements. - island: This type of challenges allows to define blocks and entities on island requirements. - nether: Nether - normal: Normal - online: Online - order: Current order [value] - other: This type of challenges allows to define Money, Experience or island level requirements. - remove-on-complete: Remove non-repeatable challenges from the challenge GUI when complete. - repeat-count: 'Current value: [value]' - repeat-reward-exp: 'Current value: [value]' - repeat-reward-money: 'Current value: [value]' - required-exp: Current necessary [value] - required-level: 'Current value: [value]' - required-money: 'Current value: [value]' - reset: Reset Challenges - if this is true, player's challenges will reset when they reset an island or if they are kicked or leave a team - reward-exp: 'Current value: [value]' - reward-money: 'Current value: [value]' - search-radius: Current radius [value] - the_end: The End - waiver-amount: 'Current value: [value]' - with_island: With Island - edit-challenge-title: Edit Challenge - edit-entities: Manage Entities - edit-level-title: Edit Levels - manage-blocks: Manage Blocks - settings-title: Edit Settings - button: - add: Add - remove-selected: Remove Selected - show-eggs: Toogle Mob View + main: + parameters: '' + description: 'Main admin command. Opens GUI.' + complete: + description: 'Mark challenge complete' + parameters: ' ' + create: + description: 'Opens GUI that allows to create challenge.' + parameters: '' + surrounding: + description: 'Create a surrounding challenge.' + parameters: '' + import: + description: 'Import challenges from challenges.yml' + parameters: '' + reload: + description: 'Reload challenges from the database' + parameters: '' + reset: + description: 'Reset challenge to 0 times / incomplete' + parameters: ' ' + show: + description: 'This method prints in chat all challenges that exist in world.' + parameters: '' + user: + description: 'This method opens Challenges GUI.' + parameters: '' + gui: + title: + admin: + gui-title: '&aChallenges Admin' + edit-challenge-title: '&aEdit Challenge' + edit-level-title: '&aEdit Level' + settings-title: '&aEdit Settings' + choose-challenge-title: '&aChoose Challenge' + choose-level-title: '&aChoose Level' + choose-user-title: '&aChoose Player' + manage-blocks: '&aManage Blocks' + manage-entities: '&aManage Entities' + confirm-title: '&aConfirmation' + manage-items: '&aManage Items' + manage-numbers: '&aNumber Pad' + select-block: '&aSelect Block' + select-challenge: '&aSelect Challenge' + select-entity: '&aSelect Entity' + toggle-environment: '&aToggle Environment' + edit-text-fields: '&aEdit Text Fields' + challenges: '&aChallenges' buttons: - back: Return - next: Next - previous: Previous - title: '"Challenges GUI"' - gui-title: '&aChallenges' - help: - command: '/challenges: &fshow challenges' - config-reloaded: Configuration reloaded from file. - reset-all-challenges: resets all of the player's challenges - reset-challenge: marks a challenge as incomplete - reset-challenge-for-all: globally resets a challenge for every player with an optional repetition - incomplete: Incomplete - item-take-warning: '&cAll required items are|&ctaken when you complete|&cthis - challenge!' - items-closeby: '&cAll required items|&cmust be close to you|&con your island!' - level: '&FLevel: [level]' - max-reached: Max reached [donetimes] out of [maxtimes] - maxed-reached: Completed [donetimes] out of [maxtimes] - money-reward: '&6Money reward: $[reward]' - name: Challenge Name - name-has-completed: '[name] has completed the [challenge] challenge!' - name-has-completed-level: '[name] completed all challenges in [level]!' - navigation: Click to see [level] challenges! - not-enough-exp: It is necessary to have [xp] EXP to complete challenge. - not-enough-money: It is necessary to have [money] on your account to complete the challenge. - not-repeatable: This challenge is not repeatable! - parameters: '[Level]' - repeat-rewards: '&6Repeat reward(s)' - repeatable: This challenge can be repeated [maxtimes] times - resetallchallenges: - success: '[name] has had all challenges reset.' - resetchallenge: - challenge-reset: 'Challenge: [challengename] has been reset for [name]' - error-challenge-does-not-exist: Challenge doesn't exist or isn't yet completed - rewards: '&FReward(s)' - to-complete: Complete [challengesToDo] more [thisLevel] challenges to unlock this level! - you-completed: You completed the [challenge] challenge! - you-completed-level: Congratulations, you complete [level]! - you-repeated: You repeated the [challenge] challenge! - missing-addon: It is not possible to complete challenge. Plugin or addon is missing. - incorrect: Current challenge is corupted. + admin: + complete: 'Complete user challenge' + reset: 'Reset user challenge' + create-challenge: 'Add new challenge' + create-level: 'Add new level' + edit-challenge: 'Edit challenge' + edit-level: 'Edit level' + delete-challenge: 'Remove challenge' + delete-level: 'Remove level' + import: 'Import ASkyblock Challenges' + backward: 'Import 0.3.0 Challenges' + settings: 'Edit Settings' + properties: 'Properties' + requirements: 'Requirements' + rewards: 'Rewards' + challenges: 'Challenges' + type: 'Challenge Type' + deployment: 'Deployment' + icon: 'Icon' + description: 'Description' + order: 'Order' + environment: 'Environment' + remove-on-complete: 'Remove after completion' + name: 'Friendly Name' + required-entities: 'Required Entities' + remove-entities: 'Remove Entities' + required-blocks: 'Required Blocks' + remove-blocks: 'Remove Blocks' + search-radius: 'Search Radius' + required-permissions: 'Required Permissions' + required-items: 'Required Items' + remove-items: 'Remove Items' + required-experience: 'Required experience' + remove-experience: 'Remove experience' + required-level: 'Required island level' + required-money: 'Required money' + remove-money: 'Remove money' + reward-text: 'Reward message' + reward-items: 'Reward items' + reward-experience: 'Reward experience' + reward-money: 'Reward money' + reward-commands: 'Reward commands' + repeatable: 'Repeatable' + repeat-count: 'Max Times' + repeat-reward-text: 'Repeat reward message' + repeat-reward-items: 'Repeat reward items' + repeat-reward-experience: 'Repeat reward experience' + repeat-reward-money: 'Repeat reward money' + repeat-reward-commands: 'Repeat reward commands' + waiver-amount: 'Waiver Amount' + add-challenge: 'Add Challenge' + remove-challenge: 'Remove Challenge' + reset-on-new: 'Reset On New Island' + broadcast: 'Broadcast Completion' + remove-completed: 'Remove after complete' + glow: 'Glow when completed' + free-at-top: 'Free challenges first' + line-length: 'Lore line length' + toggle-user-list: 'User List' + remove-selected: 'Remove Selected' + add: 'Add' + show-eggs: 'Switch View mode' + accept: 'Accept' + decline: 'Decline' + save: 'Save' + cancel: 'Cancel' + input: 'Input' + value: 'Value' + set: '=' + increase: '+' + reduce: '-' + multiply: '*' + clear: 'Clear' + remove-empty: 'Remove empty' + number: '[number]' + next: 'Next' + previous: 'Previous' + return: 'Return' + descriptions: + admin: + save: 'Save and return to previous GUI.' + cancel: 'Return to previous GUI. Changes will not be saved.' + input: 'Open text field input.' + set: 'Set operation. Clicking on numbers will change value to selected number.' + increase: 'Increase operation. Clicking on numbers will increase value by selected number.' + reduce: 'Reduce operation. Clicking on numbers will reduce value by selected number.' + multiply: 'Multiply operation. Clicking on numbers will multiply value by selected number.' + import: 'Allows to import ASkyblock Challenges.|On right click it enables/disables overwrite mode.' + complete: 'Allows to complete challenges for any user.|User will not get reward for completion.' + reset: 'Allows to reset completed user challenges.|Right click enables/disables Reset all functionality.' + create-challenge: 'Allows to add new Challenge.|By default it will be in free challenges list.' + create-level: 'Allows to add new Level.' + edit-challenge: 'Allows to edit any Challenge settings.' + edit-level: 'Allows to edit any Level settings.' + delete-challenge: 'Allows remove any Challenge.' + delete-level: 'Allows remove any Level.' + backward: 'Allows to import challenges from 0.3.0 and below addon version.' + settings: 'Allows to change addon settings.' + properties: 'Allows to change general properties' + requirements: 'Allows to manage requirements' + rewards: 'Allows to manage rewards' + challenges: 'Allows to manage level challenges (add / remove).' + deployment: 'Allows users to complete (view) challenge.' + icon-challenge: 'Icon that will be displayed in GUI panels for this challenge.' + icon-level: 'Icon that will be displayed in GUI panels for this level.' + description: 'Allows to edit description.' + order: 'Allows to change order number.' + environment: 'Allows to change environment where challenge operates.' + type: 'Allows change challenge type. Each type has their own requirements.' + remove-on-complete: 'Allows to remove challenge from player GUI after it is completed.' + name-challenge: 'Allows to change challenge display name.' + name-level: 'Allows to change level display name.' + required-entities: 'Allows to add/edit/remove required entities.|Entities:|' + remove-entities: 'Allows to remove (kill) entities on challenge completion.' + required-blocks: 'Allows to add/edit/remove required blocks.|Blocks:|' + remove-blocks: 'Allows to remove (replace with air) blocks on challenge completion.' + search-radius: 'Radius around player location where required entities and blocks will be searched.' + required-permissions: 'Required permissions for player to be able to complete challenge.|Permission:' + required-items: 'Required items in player"s inventory.|Items:' + remove-items: 'Allows to remove items from player inventory after challenge completion.' + required-experience: 'Allows to define required experience for user to complete challenge.' + remove-experience: 'Allows to remove remove required experience.' + required-level: 'Allows to define required island level for this challenge.|&cRequires Level addon.' + required-money: 'Allows to define required money in player"s account.|&cRequires Vault and Economy plugin.' + remove-money: 'Allows to remove required money from player"s account.|&cRequires Vault and Economy plugin.' + reward-text: 'Allows to change message that will be sent to player after challenges completion.' + reward-items: 'Allows to change first time completion reward items.|Items:' + reward-experience: 'Allows to change first time completion reward Experience.' + reward-money: 'Allows to change first time completion reward Money.|&cRequires Vault and Economy plugin.' + reward-commands: 'Allows to define reward commands that will be called after first time completion.|***Adding "[SELF]" at the start means that command will be run by player, f.e. "/kill"|***String "[player]" will be replaced with player name, f.e. "/kill [player]" will be transformed to "/kill BONNe1704"|Commands:' + repeatable: 'Allows to define if challenge is repeatable or not.' + repeat-count: 'Allows to define maximal repeat count. If value is set 0 or smaller, then there are no limitations.' + repeat-reward-text: 'Allows to change message that will be sent to player after challenge repeated completion.' + repeat-reward-items: 'Allows to change repeated completion reward items.|Items:' + repeat-reward-experience: 'Allows to change repeated completion reward Experience.' + repeat-reward-money: 'Allows to change repeated completion reward Money.|&cRequires Vault and Economy plugin.' + repeat-reward-commands: 'Allows to define reward commands that will be called after challenge repeated completion.|***Adding "[SELF]" at the start means that command will be run by player, f.e. "/kill"|***String "[player]" will be replaced with player name, f.e. "/kill [player]" will be transformed to "/kill BONNe1704"|Commands:' + waiver-amount: 'Allows to set how many challenges can be left undone to unlock next level.' + reward-text-level: 'Allows to change message that will be sent to player after completing all challenges in level.' + add-challenge: 'Allows to add existing challenge to current level.' + remove-challenge: 'Allows remove any challenge from current level.' + reset-on-new: 'Enables/Disables option, that resets all player challenges if player restarts island, leave island or was kicked out.' + broadcast: 'Enables/Disables broadcast to online players about first time challenge completion.' + remove-completed: 'Enables/Disables hiding challenges that are completed and cannot be repeated.' + glow: 'Enables/Disables glowing effect for completed challenges.' + free-at-top: 'Allows to change free challenges location. True mean that challenges will be first, otherwise they will be last.' + line-length: 'Allows to modify maximal line length in lore box. Will not affect stored objects.' + toggle-user-list: 'Switch to different player list.' + mode-online: 'Players which currently are online.' + mode-in-world: 'Players which is in GameMode world.' + mode-with-island: 'Players which has island in GameMode.' + selected: 'Selected' + remove-selected: 'Remove selected elements.|You can select elements with right mouse button.' + show-eggs: 'Switch entity view between Egg mode or Head mode.' + current-value: '|&6Current value: [value].' + enabled: 'Active' + disabled: 'Disabled' + type: + island: '- Island Type:| (allows to require blocks or mobs around player)' + inventory: '- Inventory Type:| (allows to require items in players inventory)' + other: '- Other Type:| (allows to require things from other plugins/addons)' + the-end: '- The End' + nether: '- Nether' + normal: '- Overworld' + entity: '- [entity] : [count]' + block: '- [block] : [count]' + permission: '- [permission]' + item: '- [count] x [item]' + item-meta: ' ([meta])' + item-enchant: ' - [enchant] [level]' + command: '- [command]' + level-unlocked: 'Click to see [level] challenges!' + level-locked: 'Complete [count] more [level] challenges to unlock this level!' + challenge-description: + level: '&FLevel: [level]' + completed: '&BCompleted' + completed-times-of: 'Completed [donetimes] out of [maxtimes]' + maxed-reached: 'Completed [donetimes] out of [maxtimes]' + completed-times: 'Completed [donetimes]' + warning-items-take: '&cAll required items are taken when you complete this challenge!' + objects-close-by: '&cAll required blocks and entities must be close to you on your island!' + warning-entities-kill: '&cAll required entities will be killed when you complete this challenge!' + warning-blocks-remove: '&cAll required blocks will be removed when you complete this challenge!' + not-repeatable: '&cThis challenge is not repeatable!' + experience-reward: '&6Exp reward: [value]' + money-reward: '&6Money reward: $[value]' + messages: + admin: + hit-things: 'Hit things to add them to the list of things required. Right click when done.' + you-added: 'You added one [thing] to the challenge' + challenge-created: '[challenge] created!' + you-completed-challenge: '&2You completed the [value] challenge!' + you-repeated-challenge: '&2You repeated the [value] challenge!' + you-completed-level: '&2You completed the [value] level!' + name-has-completed-challenge: '&5[name] has completed the [value] challenge!' + name-has-completed-level: '&5[name] has completed the [value] level!' + import-levels: 'Start importing Levels' + import-challenges: 'Start importing Challenges' + no-levels: 'Warning: No levels defined in challenges.yml' + import-number: 'Imported [number] challenges' + load-skipping: '"[value]" already exists - skipping' + load-overwriting: 'Overwriting "[value]"' + load-add: 'Adding new object: [value]' + errors: + no-name: '&cMissing challenge name' + unknown-challenge: '&cUnknown challenge' + unique-id: '&cUniqueID "[id]" is not valid.' + wrong-icon: '&cGiven material "[value]" is not valid and cannot be used as icon.' + not-valid-integer: '&cGiven integer "[value]" is not valid!|Value should be between [min] and [max].' + not-a-integer: '&cGiven value "[value]" is not integer!' + not-deployed: '&cChallenge is not deployed!' + not-on-island: '&cYou must be on your island to do that!' + challenge-level-not-available: '&cYou have not unlocked level to complete this challenge.' + not-repeatable: '&cThis challenge is not repeatable!' + wrong-environment: '&cYou are in wrong environment!' + not-enough-items: '&cYou do not have enough [items] to complete this challenge!' + not-close-enough: '&cYou must be standing within [number] blocks of all required items.' + you-still-need: '&cYou still need [amount] x [item]' + missing-addon: '&cCannot complete challenge. Required addon or plugin is missing.' + incorrect: '&cCannot complete challenge. Requirements are incorrect.' + not-enough-money: '&cIt is necessary to have [value] on your account to complete the challenge.' + not-enough-experience: '&cIt is necessary to have [value] EXP to complete challenge.' + island-level: '&cYour island must be level [number] to complete this challenge!' + import-no-file: '&cCould not find challenges.yml file to import!' + no-load: '&cError: Could not load challenges.yml. [message]' + load-error: '&cError: Cannot load [value].' +version: 2 \ No newline at end of file