aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2021-02-16 16:06:42 +0000
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2021-02-16 16:06:42 +0000
commit8b23cd0146d856acb1d1c31d88c168ff5c27cfed (patch)
tree7178b65c143eeccfcd85385dde597f51a1a96c79 /src/main/java
parente92a4ffe3f8f2d5e7098bcc9190858ac50a42292 (diff)
Make tracking toggleable
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/leonardobishop/quests/events/EventInventory.java2
-rw-r--r--src/main/java/com/leonardobishop/quests/obj/Options.java1
-rw-r--r--src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java4
3 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/leonardobishop/quests/events/EventInventory.java b/src/main/java/com/leonardobishop/quests/events/EventInventory.java
index 9554eb5e..18b14ef3 100644
--- a/src/main/java/com/leonardobishop/quests/events/EventInventory.java
+++ b/src/main/java/com/leonardobishop/quests/events/EventInventory.java
@@ -89,7 +89,7 @@ public class EventInventory implements Listener {
if (qMenuQuest.getOwner().getQuestProgressFile().startQuest(quest) == QuestStartResult.QUEST_SUCCESS) {
event.getWhoClicked().closeInventory(); //TODO Option to keep the menu open
}
- } else if (event.getClick() == ClickType.MIDDLE) {
+ } else if (event.getClick() == ClickType.MIDDLE && Options.ALLOW_QUEST_TRACK.getBooleanValue()) {
if (qMenuQuest.getOwner().getQuestProgressFile().hasStartedQuest(quest)) {
Player player = Bukkit.getPlayer(qMenuQuest.getOwner().getUuid());
String tracked = qMenuQuest.getOwner().getQuestProgressFile().getPlayerPreferences().getTrackedQuestId();
diff --git a/src/main/java/com/leonardobishop/quests/obj/Options.java b/src/main/java/com/leonardobishop/quests/obj/Options.java
index 537ba18a..d7543cec 100644
--- a/src/main/java/com/leonardobishop/quests/obj/Options.java
+++ b/src/main/java/com/leonardobishop/quests/obj/Options.java
@@ -22,6 +22,7 @@ public enum Options {
GUITITLE_DAILY_QUESTS("options.guinames.daily-quests"),
GUITITLE_QUEST_CANCEL("options.guinames.quest-cancel"),
ALLOW_QUEST_CANCEL("options.allow-quest-cancel"),
+ ALLOW_QUEST_TRACK("options.allow-quest-track"),
SOFT_CLEAN_QUESTSPROGRESSFILE_ON_JOIN("options.soft-clean-questsprogressfile-on-join"),
PUSH_SOFT_CLEAN_TO_DISK("options.tab-completion.push-soft-clean-to-disk"),
TAB_COMPLETE_ENABLED("options.tab-completion.enabled"),
diff --git a/src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java b/src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java
index b2845e67..06388a71 100644
--- a/src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java
+++ b/src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java
@@ -42,7 +42,7 @@ public class QuestProgressFile {
questProgress.setCompleted(true);
questProgress.setCompletedBefore(true);
questProgress.setCompletionDate(System.currentTimeMillis());
- if (Options.QUEST_AUTOTRACK.getBooleanValue() && !(quest.isRepeatable() && !quest.isCooldownEnabled())) {
+ if (Options.ALLOW_QUEST_TRACK.getBooleanValue() && Options.QUEST_AUTOTRACK.getBooleanValue() && !(quest.isRepeatable() && !quest.isCooldownEnabled())) {
trackQuest(null);
}
Player player = Bukkit.getPlayer(this.playerUUID);
@@ -196,7 +196,7 @@ public class QuestProgressFile {
taskProgress.setCompleted(false);
taskProgress.setProgress(null);
}
- if (Options.QUEST_AUTOTRACK.getBooleanValue()) {
+ if (Options.ALLOW_QUEST_TRACK.getBooleanValue() && Options.QUEST_AUTOTRACK.getBooleanValue()) {
trackQuest(quest);
}
questProgress.setCompleted(false);