mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +01:00
Fix redo-quest effect on non-redoable quests, fixes #299. Bump version
This commit is contained in:
parent
843697fbd9
commit
a6ebca4921
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<artifactId>quests</artifactId>
|
||||
<version>3.2.5</version>
|
||||
<version>3.2.6</version>
|
||||
<name>quests</name>
|
||||
<url>https://github.com/FlyingPikachu/Quests/</url>
|
||||
<packaging>jar</packaging>
|
||||
|
@ -51,7 +51,7 @@ public class NpcEffectThread implements Runnable {
|
||||
NPC npc = plugin.citizens.getNPCRegistry().getNPC(e);
|
||||
if (plugin.hasQuest(npc, quester)) {
|
||||
showEffect(player, npc, Quests.effect);
|
||||
} else if (plugin.hasCompletedQuest(npc, quester)) {
|
||||
} else if (plugin.hasCompletedRedoableQuest(npc, quester)) {
|
||||
showEffect(player, npc, Quests.redoEffect);
|
||||
}
|
||||
}
|
||||
|
@ -3966,6 +3966,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
return false;
|
||||
}
|
||||
|
||||
// Unused internally, left for external use
|
||||
public boolean hasCompletedQuest(NPC npc, Quester quester) {
|
||||
for (Quest q : quests) {
|
||||
if (q.npcStart != null && quester.completedQuests.contains(q.name) == true) {
|
||||
@ -3978,6 +3979,19 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasCompletedRedoableQuest(NPC npc, Quester quester) {
|
||||
for (Quest q : quests) {
|
||||
if (q.npcStart != null && quester.completedQuests.contains(q.name) == true && q.redoDelay > -1) {
|
||||
if (q.npcStart.getId() == npc.getId()) {
|
||||
if (ignoreLockedQuests == false || ignoreLockedQuests == true && q.testRequirements(quester) == true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getMCMMOSkillLevel(SkillType st, String player) {
|
||||
McMMOPlayer mPlayer = UserManager.getPlayer(player);
|
||||
|
Loading…
Reference in New Issue
Block a user