From 5a78e20efcf39d5126a246777c26cd573b08c3c3 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Sat, 11 Jun 2022 01:14:16 -0400 Subject: [PATCH] Update input validity strings --- .../convo/actions/main/ActionMainPrompt.java | 4 +-- .../convo/actions/tasks/EffectPrompt.java | 11 ++++--- .../convo/actions/tasks/PlayerPrompt.java | 6 ++-- .../convo/actions/tasks/WeatherPrompt.java | 8 ++--- .../convo/conditions/tasks/EntityPrompt.java | 8 ++--- .../convo/conditions/tasks/WorldPrompt.java | 16 ++++----- .../convo/quests/objectives/BlocksPrompt.java | 32 +++++++++--------- .../convo/quests/objectives/MobsPrompt.java | 20 +++++------ .../convo/quests/objectives/NpcsPrompt.java | 12 +++---- .../convo/quests/rewards/RewardsPrompt.java | 4 +-- .../convo/quests/stages/StageMainPrompt.java | 25 +++++--------- core/src/main/resources/strings.yml | 33 ++++++++----------- 12 files changed, 83 insertions(+), 96 deletions(-) diff --git a/core/src/main/java/me/blackvein/quests/convo/actions/main/ActionMainPrompt.java b/core/src/main/java/me/blackvein/quests/convo/actions/main/ActionMainPrompt.java index f6b3ee08e..3f04b9029 100644 --- a/core/src/main/java/me/blackvein/quests/convo/actions/main/ActionMainPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/actions/main/ActionMainPrompt.java @@ -863,8 +863,8 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt { if (MiscUtil.getProperMobType(input) != null) { questMob.setType(MiscUtil.getProperMobType(input)); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED - + Lang.get("stageEditorInvalidMob")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob") + .replace("", input)); return new ActionMobTypePrompt(context, questMob); } } diff --git a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/EffectPrompt.java b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/EffectPrompt.java index dc1d78cc2..a29e0d103 100644 --- a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/EffectPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/EffectPrompt.java @@ -25,7 +25,6 @@ import me.blackvein.quests.util.MiscUtil; import org.bukkit.ChatColor; import org.bukkit.Effect; import org.bukkit.Location; -import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.Prompt; @@ -368,19 +367,21 @@ public class EffectPrompt extends ActionsEditorNumericPrompt { } context.setSessionData(CK.E_EFFECTS, effects); if (context.getForWhom() instanceof Player) { - final Map selectedEffectLocations = plugin.getActionFactory().getSelectedEffectLocations(); + final Map selectedEffectLocations = plugin.getActionFactory() + .getSelectedEffectLocations(); selectedEffectLocations.remove(((Player)context.getForWhom()).getUniqueId()); plugin.getActionFactory().setSelectedEffectLocations(selectedEffectLocations); } return new EffectSoundListPrompt(context); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED - + Lang.get("eventEditorInvalidEffect")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidEffect") + .replace("", input)); return new EffectSoundPrompt(context); } } else { if (context.getForWhom() instanceof Player) { - final Map selectedEffectLocations = plugin.getActionFactory().getSelectedEffectLocations(); + final Map selectedEffectLocations = plugin.getActionFactory() + .getSelectedEffectLocations(); selectedEffectLocations.remove(((Player)context.getForWhom()).getUniqueId()); plugin.getActionFactory().setSelectedEffectLocations(selectedEffectLocations); } diff --git a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/PlayerPrompt.java b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/PlayerPrompt.java index 680e22909..a75caaac4 100644 --- a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/PlayerPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/PlayerPrompt.java @@ -655,12 +655,12 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt { if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) { final LinkedList effTypes = new LinkedList<>(); for (final String s : input.split(" ")) { - if (s != null && PotionEffectType.getByName(s.toUpperCase()) != null) { + if (PotionEffectType.getByName(s.toUpperCase()) != null) { effTypes.add(Objects.requireNonNull(PotionEffectType.getByName(s.toUpperCase())).getName()); context.setSessionData(CK.E_POTION_TYPES, effTypes); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("eventEditorInvalidPotionType")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidPotionType") + .replace("", s)); return new PlayerPotionTypesPrompt(context); } } diff --git a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/WeatherPrompt.java b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/WeatherPrompt.java index 7b7ecbc64..f0f727c5a 100644 --- a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/WeatherPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/WeatherPrompt.java @@ -338,8 +338,8 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt { context.setSessionData(CK.E_WORLD_STORM, Objects.requireNonNull(plugin.getServer().getWorld(input)) .getName()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED - + Lang.get("eventEditorInvalidWorld")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidWorld") + .replace("", input)); return new StormWorldPrompt(context); } } @@ -558,8 +558,8 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt { context.setSessionData(CK.E_WORLD_THUNDER, Objects.requireNonNull(plugin.getServer() .getWorld(input)).getName()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED - + Lang.get("eventEditorInvalidWorld")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidWorld") + .replace("", input)); return new ThunderWorldPrompt(context); } } diff --git a/core/src/main/java/me/blackvein/quests/convo/conditions/tasks/EntityPrompt.java b/core/src/main/java/me/blackvein/quests/convo/conditions/tasks/EntityPrompt.java index 83d3daf52..1a3f459fb 100644 --- a/core/src/main/java/me/blackvein/quests/convo/conditions/tasks/EntityPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/conditions/tasks/EntityPrompt.java @@ -222,13 +222,13 @@ public class EntityPrompt extends QuestsEditorNumericPrompt { mobTypes.add(s); context.setSessionData(CK.C_WHILE_RIDING_ENTITY, mobTypes); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("stageEditorInvalidMob")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob") + .replace("", s)); return new EntitiesPrompt(context); } } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("stageEditorInvalidMob")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob") + .replace("", s)); return new EntitiesPrompt(context); } } diff --git a/core/src/main/java/me/blackvein/quests/convo/conditions/tasks/WorldPrompt.java b/core/src/main/java/me/blackvein/quests/convo/conditions/tasks/WorldPrompt.java index cd87c5fea..461de531a 100644 --- a/core/src/main/java/me/blackvein/quests/convo/conditions/tasks/WorldPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/conditions/tasks/WorldPrompt.java @@ -225,13 +225,13 @@ public class WorldPrompt extends QuestsEditorNumericPrompt { return null; } if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) { - final LinkedList worlds = new LinkedList(); + final LinkedList worlds = new LinkedList<>(); for (final String s : input.split(" ")) { if (Bukkit.getWorld(s) != null) { worlds.add(s); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("conditionEditorInvalidWorld")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("conditionEditorInvalidWorld") + .replace("", s)); return new WorldsPrompt(context); } } @@ -266,7 +266,7 @@ public class WorldPrompt extends QuestsEditorNumericPrompt { } final StringBuilder biomes = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n"); - final LinkedList biomeArr = new LinkedList(Arrays.asList(Biome.values())); + final LinkedList biomeArr = new LinkedList<>(Arrays.asList(Biome.values())); for (int i = 0; i < biomeArr.size(); i++) { if (i < (biomeArr.size() - 1)) { biomes.append(MiscUtil.snakeCaseToUpperCamelCase(biomeArr.get(i).name())).append(", "); @@ -283,13 +283,13 @@ public class WorldPrompt extends QuestsEditorNumericPrompt { return null; } if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) { - final LinkedList biomes = new LinkedList(); + final LinkedList biomes = new LinkedList<>(); for (final String s : input.split(" ")) { if (MiscUtil.getProperBiome(s) != null) { biomes.add(s); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("conditionEditorInvalidBiome")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("conditionEditorInvalidBiome") + .replace("", s)); return new BiomesPrompt(context); } } @@ -349,7 +349,7 @@ public class WorldPrompt extends QuestsEditorNumericPrompt { return null; } if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) { - final LinkedList regions = new LinkedList(); + final LinkedList regions = new LinkedList<>(); for (final String r : input.split(" ")) { boolean found = false; for (final World world : plugin.getServer().getWorlds()) { diff --git a/core/src/main/java/me/blackvein/quests/convo/quests/objectives/BlocksPrompt.java b/core/src/main/java/me/blackvein/quests/convo/quests/objectives/BlocksPrompt.java index 1d6b8ae0d..e8f211534 100644 --- a/core/src/main/java/me/blackvein/quests/convo/quests/objectives/BlocksPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/quests/objectives/BlocksPrompt.java @@ -428,13 +428,13 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt { if (m.isBlock()) { names.add(m.name()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " - + Lang.get("stageEditorNotSolid")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotSolid") + .replace("", s)); return new BlockBreakNamesPrompt(context); } } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " - + Lang.get("stageEditorInvalidBlockName")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidBlockName") + .replace("", s)); return new BlockBreakNamesPrompt(context); } } catch (final NumberFormatException e) { @@ -798,13 +798,13 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt { if (m.isBlock()) { names.add(m.name()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " - + Lang.get("stageEditorNotSolid")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotSolid") + .replace("", s)); return new BlockDamageNamesPrompt(context); } } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " - + Lang.get("stageEditorInvalidBlockName")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidBlockName") + .replace("", s)); return new BlockDamageNamesPrompt(context); } } catch (final NumberFormatException e) { @@ -1166,13 +1166,13 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt { if (m.isBlock()) { names.add(m.name()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " - + Lang.get("stageEditorNotSolid")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotSolid") + .replace("", s)); return new BlockPlaceNamesPrompt(context); } } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED - + Lang.get("stageEditorInvalidBlockName")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidBlockName") + .replace("", s)); return new BlockPlaceNamesPrompt(context); } } catch (final NumberFormatException e) { @@ -1532,13 +1532,13 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt { if (m.isBlock()) { names.add(m.name()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " - + Lang.get("stageEditorNotSolid")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotSolid") + .replace("", s)); return new BlockUseNamesPrompt(context); } } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " - + Lang.get("stageEditorInvalidBlockName")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidBlockName") + .replace("", s)); return new BlockUseNamesPrompt(context); } } catch (final NumberFormatException e) { diff --git a/core/src/main/java/me/blackvein/quests/convo/quests/objectives/MobsPrompt.java b/core/src/main/java/me/blackvein/quests/convo/quests/objectives/MobsPrompt.java index 066a684c0..6c8723e84 100644 --- a/core/src/main/java/me/blackvein/quests/convo/quests/objectives/MobsPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/quests/objectives/MobsPrompt.java @@ -553,8 +553,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt { if (MiscUtil.getProperMobType(s) != null) { mobTypes.add(s); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("stageEditorInvalidMob")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob") + .replace("", s)); return new MobsTypesPrompt(context); } } @@ -741,8 +741,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt { } radii.add(i); } catch (final NumberFormatException e) { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED - + Lang.get("stageEditorInvalidItemName")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidItemName") + .replace("", s)); return new MobsRadiiPrompt(context); } } @@ -1010,14 +1010,14 @@ public class MobsPrompt extends QuestsEditorNumericPrompt { } context.setSessionData(pref + CK.S_TAME_AMOUNTS, amounts); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("stageEditorInvalidMob")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob") + .replace("", s)); return new MobsTameTypesPrompt(context); } } } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("stageEditorInvalidMob")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidMob") + .replace("", s)); return new MobsTameTypesPrompt(context); } } @@ -1393,8 +1393,8 @@ public class MobsPrompt extends QuestsEditorNumericPrompt { } context.setSessionData(pref + CK.S_SHEAR_AMOUNTS, amounts); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED - + Lang.get("stageEditorInvalidDye")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidDye") + .replace("", s)); return new MobsShearColorsPrompt(context); } } diff --git a/core/src/main/java/me/blackvein/quests/convo/quests/objectives/NpcsPrompt.java b/core/src/main/java/me/blackvein/quests/convo/quests/objectives/NpcsPrompt.java index e0ffbb7c8..88560fbaa 100644 --- a/core/src/main/java/me/blackvein/quests/convo/quests/objectives/NpcsPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/quests/objectives/NpcsPrompt.java @@ -463,8 +463,8 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt { if (plugin.getDependencies().getNPCName(uuid) != null && npcs != null) { npcs.add(uuid.toString()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + uuid + ChatColor.RED + " " - + Lang.get("stageEditorInvalidNPC")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidNPC") + .replace("", s)); return new NpcDeliveryNpcsPrompt(context); } } catch (final IllegalArgumentException e) { @@ -581,8 +581,8 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt { if (plugin.getDependencies().getNPCName(uuid) != null && npcs != null) { npcs.add(uuid.toString()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + uuid + ChatColor.RED + " " - + Lang.get("stageEditorInvalidNPC")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidNPC") + .replace("", s)); return new NpcsIdsToTalkToPrompt(context); } } catch (final NumberFormatException e) { @@ -807,8 +807,8 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt { if (plugin.getDependencies().getNPCName(uuid) != null && npcs != null) { npcs.add(uuid.toString()); } else { - context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + uuid + ChatColor.RED + " " - + Lang.get("stageEditorInvalidNPC")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorInvalidNPC") + .replace("", s)); return new NpcIdsToKillPrompt(context); } } catch (final IllegalArgumentException e) { diff --git a/core/src/main/java/me/blackvein/quests/convo/quests/rewards/RewardsPrompt.java b/core/src/main/java/me/blackvein/quests/convo/quests/rewards/RewardsPrompt.java index 5136f8006..3bb63d250 100644 --- a/core/src/main/java/me/blackvein/quests/convo/quests/rewards/RewardsPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/quests/rewards/RewardsPrompt.java @@ -1079,8 +1079,8 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt { for (final String w : worlds) { if (!w.equals("null") && context.getPlugin() != null && context.getPlugin().getServer().getWorld(w) == null) { - context.getForWhom().sendRawMessage(ChatColor.RED + w + " " - + Lang.get("eventEditorInvalidWorld")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidWorld") + .replace("", w)); return new PermissionsWorldsPrompt(context); } } diff --git a/core/src/main/java/me/blackvein/quests/convo/quests/stages/StageMainPrompt.java b/core/src/main/java/me/blackvein/quests/convo/quests/stages/StageMainPrompt.java index 2cc43add6..af27d30b0 100644 --- a/core/src/main/java/me/blackvein/quests/convo/quests/stages/StageMainPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/quests/stages/StageMainPrompt.java @@ -1477,8 +1477,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { } } if (found == null) { - player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " - + Lang.get("stageEditorInvalidEvent")); + player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidEvent").replace("", input)); return new StartActionPrompt(context); } else { context.setSessionData(stagePrefix + CK.S_START_EVENT, found.getName()); @@ -1544,8 +1543,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { } } if (found == null) { - player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " - + Lang.get("stageEditorInvalidEvent")); + player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidEvent").replace("", input)); return new FinishActionPrompt(context); } else { context.setSessionData(stagePrefix + CK.S_FINISH_EVENT, found.getName()); @@ -1611,8 +1609,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { } } if (found == null) { - player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " - + Lang.get("stageEditorInvalidEvent")); + player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidEvent").replace("", input)); return new FailActionPrompt(context); } else { context.setSessionData(stagePrefix + CK.S_FAIL_EVENT, found.getName()); @@ -1678,8 +1675,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { } } if (found == null) { - player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " - + Lang.get("stageEditorInvalidEvent")); + player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidEvent").replace("", input)); return new DeathActionPrompt(context); } else { context.setSessionData(stagePrefix + CK.S_DEATH_EVENT, found.getName()); @@ -1745,8 +1741,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { } } if (found == null) { - player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " - + Lang.get("stageEditorInvalidEvent")); + player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidEvent").replace("", input)); return new DisconnectActionPrompt(context); } else { context.setSessionData(stagePrefix + CK.S_DISCONNECT_EVENT, found.getName()); @@ -1812,8 +1807,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { } } if (found == null) { - player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " - + Lang.get("stageEditorInvalidEvent")); + player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidEvent").replace("", input)); return new ChatActionPrompt(context); } else { context.setSessionData(stagePrefix + CK.S_CHAT_TEMP_EVENT, found.getName()); @@ -1954,8 +1948,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { } } if (found == null) { - player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " - + Lang.get("stageEditorInvalidEvent")); + player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidEvent").replace("", input)); return new CommandActionPrompt(context); } else { context.setSessionData(stagePrefix + CK.S_COMMAND_TEMP_EVENT, found.getName()); @@ -2097,8 +2090,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { } } if (found == null) { - player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " - + Lang.get("stageEditorInvalidCondition")); + player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidCondition") + .replace("", input)); return new ConditionListPrompt(context); } else { context.setSessionData(stagePrefix + CK.S_CONDITION, found.getName()); diff --git a/core/src/main/resources/strings.yml b/core/src/main/resources/strings.yml index 856b3abc8..9a55f4432 100644 --- a/core/src/main/resources/strings.yml +++ b/core/src/main/resources/strings.yml @@ -224,16 +224,15 @@ stageEditorPasswordPhrasePrompt: "Enter password phrases, , " stageEditorDeliveryAddItem: "Add item" stageEditorNPCUniqueIds: "Add NPC UUIDs" stageEditorDeliveryMessages: "Set partial delivery messages" -stageEditorNotSolid: "is not a solid block!" -stageEditorInvalidBlockName: "is not a valid block name!" -stageEditorInvalidEnchantment: "is not a valid enchantment name!" -stageEditorInvalidNPC: "is not a valid NPC UUID!" -stageEditorInvalidMob: "is not a valid mob name!" -stageEditorInvalidItemName: "is not a valid item name!" -stageEditorInvalidDye: "is not a valid dye color!" -stageEditorInvalidEvent: "is not a valid action name!" +stageEditorNotSolid: " is not a solid block!" +stageEditorInvalidBlockName: " is not a valid block name!" +stageEditorInvalidNPC: " is not a valid NPC UUID!" +stageEditorInvalidMob: " is not a valid mob name!" +stageEditorInvalidItemName: " is not a valid item name!" +stageEditorInvalidDye: " is not a valid dye color!" +stageEditorInvalidCondition: " is not a valid condition name!" +stageEditorInvalidEvent: " is not a valid action name!" stageEditorDuplicateEvent: "Action is already in the list!" -stageEditorInvalidCondition: "is not a valid condition name!" stageEditorInvalidScript: "Denizen script not found!" stageEditorNoCitizens: "Citizens is not installed!" stageEditorNoDenizen: "Denizen is not installed!" @@ -309,15 +308,10 @@ eventEditorSetCommands: "Execute commands" eventEditorItems: "Action Items" eventEditorSetItems: "Give items" eventEditorItemsCleared: "Action items cleared." -eventEditorSetItemNames: "Set item names" -eventEditorSetItemAmounts: "Set item amounts" -eventEditorNoNames: "No names set" -eventEditorMustSetNames: "You must set item names first!" -eventEditorInvalidName: "is not a valid item name!" eventEditorSetWorld: "Set world" eventEditorSetDuration: "Set duration" eventEditorSetWorldFirst: "You must set a world first!" -eventEditorInvalidWorld: "is not a valid world name!" +eventEditorInvalidWorld: " is not a valid world name!" eventEditorMustSetStormDuration: "You must set a storm duration!" eventEditorStormCleared: "Storm data cleared." eventEditorEnterStormWorld: "Enter a world name for the storm to occur in, " @@ -328,7 +322,7 @@ eventEditorEnterThunderWorld: "Enter a world name for the thunder to occur in, < eventEditorAddEffect: "Add sound effect" eventEditorAddEffectLocation: "Add sound effect location" eventEditorMustAddEffects: "You must add sound effects first!" -eventEditorInvalidEffect: "is not a valid sound effect name!" +eventEditorInvalidEffect: " is not a valid sound effect name!" eventEditorEffectsCleared: "Action sound effects cleared." eventEditorEffectLocationPrompt: "Right-click on a block to play a sound effect at, , " eventEditorAddMobTypes: "Add mob" @@ -360,7 +354,7 @@ eventEditorMustSetPotionDurationsFirst: "You must set potion effect durations fi eventEditorMustSetPotionTypesAndDurationsFirst: "You must set potion effect types and durations first!" eventEditorSetPotionMagnitudes: "Set potion effect magnitudes" eventEditorPotionsCleared: "Potion effects cleared." -eventEditorInvalidPotionType: "is not a valid potion effect type!" +eventEditorInvalidPotionType: " is not a valid potion effect type!" eventEditorLightningPrompt: "Right-click on a block to spawn a lightning strike at, , , " eventEditorExplosionPrompt: "Right-click on a block to spawn an explosion at, , , " eventEditorSelectBlockFirst: "You must select a block first." @@ -406,15 +400,14 @@ conditionEditorItemsInMainHand: "Hold in main hand" conditionEditorWorldsTitle: "- Worlds -" conditionEditorWorldsPrompt: "Enter world names, , " conditionEditorStayWithinWorld: "Stay within world" -conditionEditorInvalidWorld: "is not a valid world name!" +conditionEditorInvalidWorld: " is not a valid world name!" conditionEditorBiomesTitle: "- Biomes -" conditionEditorBiomesPrompt: "Enter biome names, , " conditionEditorStayWithinBiome: "Stay within biome" -conditionEditorInvalidBiome: "is not a valid biome name!" +conditionEditorInvalidBiome: " is not a valid biome name!" conditionEditorRegionsTitle: "- Regions -" conditionEditorRegionsPrompt: "Enter region names, , " conditionEditorStayWithinRegion: "Stay within region" -conditionEditorInvalidRegion: "is not a valid region name!" conditionEditorPlaceholderTitle: "- PlaceholderAPI -" conditionEditorSetPlaceholderId: "Set placeholder identifiers" conditionEditorSetPlaceholderVal: "Set placeholder values"