mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-03 17:29:57 +01:00
Resolve skipping stages with delays after relogging, fixes #810
This commit is contained in:
parent
a77a917e3f
commit
98372258eb
@ -181,6 +181,12 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
if (quester.getCurrentQuests().isEmpty() == false) {
|
if (quester.getCurrentQuests().isEmpty() == false) {
|
||||||
for (Quest q : quester.getCurrentQuests().keySet()) {
|
for (Quest q : quester.getCurrentQuests().keySet()) {
|
||||||
Stage stage = quester.getCurrentStage(q);
|
Stage stage = quester.getCurrentStage(q);
|
||||||
|
LinkedList<Stage> stages = q.getStages();
|
||||||
|
for (Stage s : stages) {
|
||||||
|
if (s.equals(quester.getCurrentStage(q))) {
|
||||||
|
System.out.println(ChatColor.LIGHT_PURPLE + "quest (" + Lang.get("stageEditorStage") + " " + (stages.indexOf(s) + 1) + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
q.updateCompass(quester, stage);
|
q.updateCompass(quester, stage);
|
||||||
if (plugin.getQuester(player.getUniqueId()).getQuestData(q).delayStartTime == 0) {
|
if (plugin.getQuester(player.getUniqueId()).getQuestData(q).delayStartTime == 0) {
|
||||||
String msg = Lang.get(player, "questObjectivesTitle");
|
String msg = Lang.get(player, "questObjectivesTitle");
|
||||||
@ -536,14 +542,10 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest") + " " + ChatColor.DARK_PURPLE + Lang.get("none"));
|
cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest") + " " + ChatColor.DARK_PURPLE + Lang.get("none"));
|
||||||
} else {
|
} else {
|
||||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest"));
|
cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest"));
|
||||||
for (Quest q : quester.getCurrentQuests().keySet()) {
|
for (Entry<Quest, Integer> set : quester.getCurrentQuests().entrySet()) {
|
||||||
String msg = ChatColor.LIGHT_PURPLE + " - " + ChatColor.DARK_PURPLE + q.getName();
|
Quest q = set.getKey();
|
||||||
LinkedList<Stage> stages = q.getStages();
|
String msg = ChatColor.LIGHT_PURPLE + " - " + ChatColor.DARK_PURPLE + q.getName()
|
||||||
for (Stage s : stages) {
|
+ ChatColor.LIGHT_PURPLE + " (" + Lang.get("stageEditorStage") + " " + (set.getValue() + 1) + ")";
|
||||||
if (s.equals(quester.getCurrentStage(q))) {
|
|
||||||
msg += ChatColor.LIGHT_PURPLE + " (" + Lang.get("stageEditorStage") + " " + (stages.indexOf(s) + 1) + ")";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cs.sendMessage(msg);
|
cs.sendMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -783,7 +783,7 @@ public class PlayerListener implements Listener {
|
|||||||
quester.checkQuest(quest);
|
quester.checkQuest(quest);
|
||||||
}
|
}
|
||||||
for (Quest quest : quester.getCurrentQuests().keySet()) {
|
for (Quest quest : quester.getCurrentQuests().keySet()) {
|
||||||
if (quester.getCurrentStage(quest).getDelay() > -1) {
|
if (quester.getCurrentStage(quest).getDelay() > -1 && quester.getQuestData(quest).delayOver == false) {
|
||||||
quester.startStageTimer(quest);
|
quester.startStageTimer(quest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ public class StageTimer implements Runnable {
|
|||||||
}
|
}
|
||||||
quest.completeQuest(quester);
|
quest.completeQuest(quester);
|
||||||
} else {
|
} else {
|
||||||
|
System.out.println("get delay = " + quester.getCurrentStage(quest).getDelay());
|
||||||
Stage currentStage = quester.getCurrentStage(quest);
|
Stage currentStage = quester.getCurrentStage(quest);
|
||||||
int stageNum = quester.getCurrentQuests().get(quest) + 1;
|
int stageNum = quester.getCurrentQuests().get(quest) + 1;
|
||||||
quester.hardQuit(quest);
|
quester.hardQuit(quest);
|
||||||
|
Loading…
Reference in New Issue
Block a user