Check quest before multiplayer dispatch, fixes #1185. Bump version

This commit is contained in:
PikaMug 2020-04-10 18:17:41 -04:00
parent 588902e81c
commit 3e975a30a1
7 changed files with 19 additions and 9 deletions

2
dist/pom.xml vendored
View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.9.2</version>
<version>3.9.3</version>
</parent>
<artifactId>quests-dist</artifactId>
<packaging>pom</packaging>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.9.2</version>
<version>3.9.3</version>
</parent>
<artifactId>quests-main</artifactId>

View File

@ -3676,13 +3676,16 @@ public class Quester {
* @param fun The function to execute, the event call
*/
public void dispatchMultiplayerEverything(Quest quest, String objectiveType, Function<Quester, Void> fun) {
if (quest == null) {
return;
}
if (quest.getOptions().getShareProgressLevel() == 1) {
List<Quester> mq = getMultiplayerQuesters(quest);
if (mq == null) {
return;
}
for (Quester q : mq) {
if (q.getCurrentStage(quest).containsObjective(objectiveType)) {
if (q != null && q.getCurrentStage(quest).containsObjective(objectiveType)) {
if (this.getCurrentStage(quest).containsObjective(objectiveType)
|| !quest.getOptions().getRequireSameQuest()) {
fun.apply(q);
@ -3700,10 +3703,17 @@ public class Quester {
* @param fun The function to execute, the event call
*/
public void dispatchMultiplayerObjectives(Quest quest, Stage currentStage, Function<Quester, Void> fun) {
if (quest == null) {
return;
}
if (quest.getOptions().getShareProgressLevel() == 2) {
List<Quester> mq = getMultiplayerQuesters(quest);
if (mq == null) {
return;
}
for (Quester q : mq) {
if ((q.getCurrentQuests().containsKey(quest) && currentStage.equals(q.getCurrentStage(quest)))
if (q != null
&& (q.getCurrentQuests().containsKey(quest) && currentStage.equals(q.getCurrentStage(quest)))
|| !quest.getOptions().getRequireSameQuest()) {
fun.apply(q);
}

View File

@ -6,12 +6,12 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.9.2</version>
<version>3.9.3</version>
<name>quests</name>
<url>https://github.com/PikaMug/Quests/</url>
<properties>
<revision>3.9.2</revision>
<revision>3.9.3</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.9.2</version>
<version>3.9.3</version>
</parent>
<properties>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.9.2</version>
<version>3.9.3</version>
</parent>
<properties>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.9.2</version>
<version>3.9.3</version>
</parent>
<properties>