From 06ce022d3722c318265248210b36a235aaf5faca Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Mon, 11 Jan 2021 01:00:04 -0500 Subject: [PATCH] Tweak config setting for new multiplayer option --- main/src/main/java/me/blackvein/quests/Options.java | 10 +++++----- .../main/java/me/blackvein/quests/QuestFactory.java | 6 +++--- main/src/main/java/me/blackvein/quests/Quester.java | 2 +- main/src/main/java/me/blackvein/quests/Quests.java | 6 +++--- .../quests/convo/quests/options/OptionsPrompt.java | 8 ++++---- main/src/main/java/me/blackvein/quests/util/CK.java | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/main/src/main/java/me/blackvein/quests/Options.java b/main/src/main/java/me/blackvein/quests/Options.java index 04f1353b7..93065b28c 100644 --- a/main/src/main/java/me/blackvein/quests/Options.java +++ b/main/src/main/java/me/blackvein/quests/Options.java @@ -21,7 +21,7 @@ public class Options { private boolean partiesHandleOfflinePlayers = false; private long partiesDistance = 0; private int shareProgressLevel = 1; - private boolean shareOnlySameQuest = true; + private boolean shareSameQuestOnly = true; public boolean canAllowCommands() { return allowCommands; @@ -87,11 +87,11 @@ public class Options { this.shareProgressLevel = shareProgressLevel; } - public boolean canShareOnlySameQuest() { - return shareOnlySameQuest; + public boolean canShareSameQuestOnly() { + return shareSameQuestOnly; } - public void setShareOnlySameQuest(final boolean shareOnlySameQuest) { - this.shareOnlySameQuest = shareOnlySameQuest; + public void setShareSameQuestOnly(final boolean shareSameQuestOnly) { + this.shareSameQuestOnly = shareSameQuestOnly; } } diff --git a/main/src/main/java/me/blackvein/quests/QuestFactory.java b/main/src/main/java/me/blackvein/quests/QuestFactory.java index 2057861d6..cf97458b8 100644 --- a/main/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/main/src/main/java/me/blackvein/quests/QuestFactory.java @@ -285,7 +285,7 @@ public class QuestFactory implements ConversationAbandonedListener { context.setSessionData(CK.OPT_USE_DUNGEONSXL_PLUGIN, opt.canUseDungeonsXLPlugin()); context.setSessionData(CK.OPT_USE_PARTIES_PLUGIN, opt.canUsePartiesPlugin()); context.setSessionData(CK.OPT_SHARE_PROGRESS_LEVEL, opt.getShareProgressLevel()); - context.setSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST, opt.canShareOnlySameQuest()); + context.setSessionData(CK.OPT_SAME_QUEST_ONLY, opt.canShareSameQuestOnly()); // Stages (Objectives) int index = 1; for (final Stage stage : q.getStages()) { @@ -949,8 +949,8 @@ public class QuestFactory implements ConversationAbandonedListener { ? (Boolean) context.getSessionData(CK.OPT_USE_PARTIES_PLUGIN) : null); opts.set("share-progress-level", context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL) != null ? (Integer) context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL) : null); - opts.set("share-only-same-quest", context.getSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST) != null - ? (Boolean) context.getSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST) : null); + opts.set("same-quest-only", context.getSessionData(CK.OPT_SAME_QUEST_ONLY) != null + ? (Boolean) context.getSessionData(CK.OPT_SAME_QUEST_ONLY) : null); if (opts.getKeys(false).isEmpty()) { section.set("options", null); } diff --git a/main/src/main/java/me/blackvein/quests/Quester.java b/main/src/main/java/me/blackvein/quests/Quester.java index 6ff479088..0cc31c300 100644 --- a/main/src/main/java/me/blackvein/quests/Quester.java +++ b/main/src/main/java/me/blackvein/quests/Quester.java @@ -3986,7 +3986,7 @@ public class Quester implements Comparable { if (q == null) { continue; } - if (quest.getOptions().canShareOnlySameQuest()) { + if (quest.getOptions().canShareSameQuestOnly()) { if (q.getCurrentStage(quest) != null) { fun.apply(q, quest); } diff --git a/main/src/main/java/me/blackvein/quests/Quests.java b/main/src/main/java/me/blackvein/quests/Quests.java index e1d340270..1fecc9c74 100644 --- a/main/src/main/java/me/blackvein/quests/Quests.java +++ b/main/src/main/java/me/blackvein/quests/Quests.java @@ -1881,7 +1881,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener if (config.getInt("quests." + questKey + ".rewards.parties-experience", -999) != -999) { rews.setPartiesExperience(config.getInt("quests." + questKey + ".rewards.parties-experience")); } else { - throw new QuestFormatException("Reward Parties experience is not a number", questKey); + throw new QuestFormatException("Reward parties-experience is not a number", questKey); } } } @@ -2177,8 +2177,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener if (config.contains("quests." + questKey + ".options.share-progress-level")) { opts.setShareProgressLevel(config.getInt("quests." + questKey + ".options.share-progress-level")); } - if (config.contains("quests." + questKey + ".options.share-only-same-quest")) { - opts.setShareOnlySameQuest(config.getBoolean("quests." + questKey + ".options.share-only-same-quest")); + if (config.contains("quests." + questKey + ".options.same-quest-only")) { + opts.setShareSameQuestOnly(config.getBoolean("quests." + questKey + ".options.same-quest-only")); } } diff --git a/main/src/main/java/me/blackvein/quests/convo/quests/options/OptionsPrompt.java b/main/src/main/java/me/blackvein/quests/convo/quests/options/OptionsPrompt.java index ba7210c3b..720b6c9ef 100644 --- a/main/src/main/java/me/blackvein/quests/convo/quests/options/OptionsPrompt.java +++ b/main/src/main/java/me/blackvein/quests/convo/quests/options/OptionsPrompt.java @@ -502,13 +502,13 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt { return ChatColor.GRAY + "(" + ChatColor.AQUA + String.valueOf(shareOpt) + ChatColor.GRAY + ")"; } case 4: - if (context.getSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST) == null) { - final boolean defaultOpt = new Options().canShareOnlySameQuest(); + if (context.getSessionData(CK.OPT_SAME_QUEST_ONLY) == null) { + final boolean defaultOpt = new Options().canShareSameQuestOnly(); return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN + Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED + Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")"; } else { - final boolean requireOpt = (Boolean) context.getSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST); + final boolean requireOpt = (Boolean) context.getSessionData(CK.OPT_SAME_QUEST_ONLY); return ChatColor.GRAY + "(" + (requireOpt ? ChatColor.GREEN + Lang.get(String.valueOf(requireOpt)) : ChatColor.RED + Lang.get(String.valueOf(requireOpt))) + ChatColor.GRAY + ")"; @@ -549,7 +549,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt { tempPrompt = new OptionsMultiplayerPrompt(context); return new OptionsLevelPrompt(context); case 4: - tempKey = CK.OPT_SHARE_ONLY_SAME_QUEST; + tempKey = CK.OPT_SAME_QUEST_ONLY; tempPrompt = new OptionsMultiplayerPrompt(context); return new OptionsTrueFalsePrompt(context); case 5: diff --git a/main/src/main/java/me/blackvein/quests/util/CK.java b/main/src/main/java/me/blackvein/quests/util/CK.java index 20be3d1b9..1d767b546 100644 --- a/main/src/main/java/me/blackvein/quests/util/CK.java +++ b/main/src/main/java/me/blackvein/quests/util/CK.java @@ -149,7 +149,7 @@ public class CK { public static final String OPT_USE_DUNGEONSXL_PLUGIN = "useDungeonsXLPluginOpt"; public static final String OPT_USE_PARTIES_PLUGIN = "usePartiesPluginOpt"; public static final String OPT_SHARE_PROGRESS_LEVEL = "shareProgressLevelOpt"; - public static final String OPT_SHARE_ONLY_SAME_QUEST = "shareOnlySameQuestOpt"; + public static final String OPT_SAME_QUEST_ONLY = "sameQuestOnlyOpt"; // Actions public static final String E_OLD_EVENT = "oldEvent"; public static final String E_NAME = "evtName";