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> <parent>
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId> <artifactId>quests-parent</artifactId>
<version>3.9.2</version> <version>3.9.3</version>
</parent> </parent>
<artifactId>quests-dist</artifactId> <artifactId>quests-dist</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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