mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-14 22:55:54 +01:00
Fix /quests stats for redo-quests, per #92
This commit is contained in:
parent
56517599a2
commit
3b394dfad7
@ -258,7 +258,9 @@ public class Quest {
|
||||
public void completeQuest(Quester q) {
|
||||
final Player player = plugin.getServer().getPlayer(q.id);
|
||||
q.hardQuit(this);
|
||||
q.completedQuests.add(name);
|
||||
if (!q.completedQuests.contains(name)) {
|
||||
q.completedQuests.add(name);
|
||||
}
|
||||
String none = ChatColor.GRAY + "- (" + Lang.get("none") + ")";
|
||||
final String ps = Quests.parseString(finished, this);
|
||||
for (Map.Entry<Integer, Quest> entry : q.timers.entrySet()) {
|
||||
@ -282,6 +284,11 @@ public class Quest {
|
||||
}
|
||||
if (redoDelay > -1) {
|
||||
q.completedTimes.put(this.name, System.currentTimeMillis());
|
||||
if (q.amountsCompleted.containsKey(this.name)) {
|
||||
q.amountsCompleted.put(this.name, q.amountsCompleted.get(this.name) + 1);
|
||||
} else {
|
||||
q.amountsCompleted.put(this.name, 1);
|
||||
}
|
||||
}
|
||||
for (ItemStack i : itemRewards) {
|
||||
Quests.addItem(player, i);
|
||||
|
@ -1930,7 +1930,9 @@ public class Quester {
|
||||
for (String s : data.getStringList("completed-Quests")) {
|
||||
for (Quest q : plugin.quests) {
|
||||
if (q.name.equalsIgnoreCase(s)) {
|
||||
completedQuests.add(q.name);
|
||||
if (!completedQuests.contains(q.name)) {
|
||||
completedQuests.add(q.name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user