From f7ddf641aa4ea4d27e4d4728ced756505af237bf Mon Sep 17 00:00:00 2001 From: PikaMug Date: Tue, 7 Jan 2020 03:28:11 -0500 Subject: [PATCH] Replace all unnecessary regex usage --- .../me/blackvein/quests/QuestFactory.java | 4 ++-- .../me/blackvein/quests/actions/Action.java | 4 ++-- .../quests/actions/ActionFactory.java | 4 ++-- .../quests/prompts/DateTimePrompt.java | 2 +- .../quests/prompts/GUIDisplayPrompt.java | 2 +- .../quests/prompts/ItemStackPrompt.java | 2 +- .../blackvein/quests/prompts/MobsPrompt.java | 2 +- .../quests/prompts/RequirementsPrompt.java | 18 +++++++-------- .../quests/prompts/StageMainPrompt.java | 2 +- .../java/me/blackvein/quests/util/Lang.java | 22 +++++++++---------- .../me/blackvein/quests/util/MiscUtil.java | 4 +++- 11 files changed, 34 insertions(+), 32 deletions(-) diff --git a/main/src/main/java/me/blackvein/quests/QuestFactory.java b/main/src/main/java/me/blackvein/quests/QuestFactory.java index 733f82a27..cb7382110 100644 --- a/main/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/main/src/main/java/me/blackvein/quests/QuestFactory.java @@ -1244,7 +1244,7 @@ public class QuestFactory implements ConversationAbandonedListener { } if (found == null) { String error = Lang.get("questWGInvalidRegion"); - error = error.replaceAll("", ChatColor.RED + input + ChatColor.YELLOW); + error = error.replace("", ChatColor.RED + input + ChatColor.YELLOW); player.sendMessage(ChatColor.YELLOW + error); return new RegionPrompt(); } else { @@ -1379,7 +1379,7 @@ public class QuestFactory implements ConversationAbandonedListener { saveQuest(context, newSection); data.save(new File(plugin.getDataFolder(), "quests.yml")); context.getForWhom().sendRawMessage(ChatColor.GREEN - + Lang.get("questEditorSaved").replaceAll("", "/questadmin " + + Lang.get("questEditorSaved").replace("", "/questadmin " + Lang.get("COMMAND_QUESTADMIN_RELOAD"))); } catch (IOException e) { e.printStackTrace(); diff --git a/main/src/main/java/me/blackvein/quests/actions/Action.java b/main/src/main/java/me/blackvein/quests/actions/Action.java index d5cefddf8..22a98fcc2 100644 --- a/main/src/main/java/me/blackvein/quests/actions/Action.java +++ b/main/src/main/java/me/blackvein/quests/actions/Action.java @@ -330,7 +330,7 @@ public class Action { if (commands.isEmpty() == false) { for (String s : commands) { plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), - s.replaceAll("", quester.getPlayer().getName())); + s.replace("", quester.getPlayer().getName())); } } if (potionEffects.isEmpty() == false) { @@ -364,7 +364,7 @@ public class Action { quest.failQuest(quester); } if (timer > 0) { - player.sendMessage(Lang.get(player, "timerStart").replaceAll("