Fixed multiplayer check

This commit is contained in:
AlessioDP 2019-09-14 12:33:53 +02:00
parent e45412ad25
commit c7ebc22eed
No known key found for this signature in database
GPG Key ID: B92B813840FFCC9F

View File

@ -729,10 +729,13 @@ 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) {
if ((quester.getCurrentQuests().containsKey(quest) && quester.containsObjective(quest, "killMob")) boolean multiplayer = !quest.getOptions().getRequireSameQuest();
|| !quest.getOptions().getRequireSameQuest()) { 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;