mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-01 07:03:55 +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) {
|
public void completeQuest(Quester q) {
|
||||||
final Player player = plugin.getServer().getPlayer(q.id);
|
final Player player = plugin.getServer().getPlayer(q.id);
|
||||||
q.hardQuit(this);
|
q.hardQuit(this);
|
||||||
|
if (!q.completedQuests.contains(name)) {
|
||||||
q.completedQuests.add(name);
|
q.completedQuests.add(name);
|
||||||
|
}
|
||||||
String none = ChatColor.GRAY + "- (" + Lang.get("none") + ")";
|
String none = ChatColor.GRAY + "- (" + Lang.get("none") + ")";
|
||||||
final String ps = Quests.parseString(finished, this);
|
final String ps = Quests.parseString(finished, this);
|
||||||
for (Map.Entry<Integer, Quest> entry : q.timers.entrySet()) {
|
for (Map.Entry<Integer, Quest> entry : q.timers.entrySet()) {
|
||||||
@ -282,6 +284,11 @@ public class Quest {
|
|||||||
}
|
}
|
||||||
if (redoDelay > -1) {
|
if (redoDelay > -1) {
|
||||||
q.completedTimes.put(this.name, System.currentTimeMillis());
|
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) {
|
for (ItemStack i : itemRewards) {
|
||||||
Quests.addItem(player, i);
|
Quests.addItem(player, i);
|
||||||
|
@ -1930,7 +1930,9 @@ public class Quester {
|
|||||||
for (String s : data.getStringList("completed-Quests")) {
|
for (String s : data.getStringList("completed-Quests")) {
|
||||||
for (Quest q : plugin.quests) {
|
for (Quest q : plugin.quests) {
|
||||||
if (q.name.equalsIgnoreCase(s)) {
|
if (q.name.equalsIgnoreCase(s)) {
|
||||||
|
if (!completedQuests.contains(q.name)) {
|
||||||
completedQuests.add(q.name);
|
completedQuests.add(q.name);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user