mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-28 13:45:32 +01:00
Support both types of progress sharing w/o overriding quest option
This commit is contained in:
parent
c268dca82f
commit
17ac3b9430
@ -3282,9 +3282,12 @@ public class Quester {
|
|||||||
List<Quester> mq = getMultiplayerQuesters(quest);
|
List<Quester> mq = getMultiplayerQuesters(quest);
|
||||||
for (Quester q : mq) {
|
for (Quester q : mq) {
|
||||||
if (q.containsObjective(quest, objectiveType)) {
|
if (q.containsObjective(quest, objectiveType)) {
|
||||||
fun.apply(q);
|
if (quest.getOptions().getRequireSameQuest() && this.containsObjective(quest, objectiveType)) {
|
||||||
|
fun.apply(q);
|
||||||
|
} else if (!quest.getOptions().getRequireSameQuest()) {
|
||||||
|
fun.apply(q);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -729,18 +729,14 @@ public class PlayerListener implements Listener {
|
|||||||
Quester quester = plugin.getQuester(damager.getUniqueId());
|
Quester quester = plugin.getQuester(damager.getUniqueId());
|
||||||
LinkedList<Quest> allQuests = plugin.getQuests();
|
LinkedList<Quest> allQuests = plugin.getQuests();
|
||||||
for (Quest quest : allQuests) {
|
for (Quest quest : allQuests) {
|
||||||
boolean multiplayer = !quest.getOptions().getRequireSameQuest();
|
|
||||||
if (quester.getCurrentQuests().containsKey(quest) && quester.containsObjective(quest, "killMob")) {
|
if (quester.getCurrentQuests().containsKey(quest) && quester.containsObjective(quest, "killMob")) {
|
||||||
quester.killMob(quest, target.getLocation(), target.getType());
|
quester.killMob(quest, target.getLocation(), target.getType());
|
||||||
multiplayer = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multiplayer) {
|
quester.dispatchMultiplayerEverything(quest, "killMob", (Quester q) -> {
|
||||||
quester.dispatchMultiplayerEverything(quest, "killMob", (Quester q) -> {
|
q.killMob(quest, target.getLocation(), target.getType());
|
||||||
q.killMob(quest, target.getLocation(), target.getType());
|
return null;
|
||||||
return null;
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user