mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-17 04:51:19 +01:00
Internally take quest exclusively with ID
This commit is contained in:
parent
d655d99ce9
commit
5f40c4de3b
@ -254,7 +254,7 @@ public class Quester implements Comparable<Quester> {
|
||||
return questIdToTake;
|
||||
}
|
||||
|
||||
public void setQuestToTake(final String questIdToTake) {
|
||||
public void setQuestIdToTake(final String questIdToTake) {
|
||||
this.questIdToTake = questIdToTake;
|
||||
}
|
||||
|
||||
@ -3699,7 +3699,7 @@ public class Quester implements Comparable<Quester> {
|
||||
if (canAcceptOffer(quest, giveReason)) {
|
||||
if (getPlayer() instanceof Conversable) {
|
||||
if (getPlayer().isConversing() == false) {
|
||||
setQuestToTake(quest.getName());
|
||||
setQuestIdToTake(quest.getId());
|
||||
final String s = ChatColor.GOLD + "- " + ChatColor.DARK_PURPLE + quest.getName() + ChatColor.GOLD
|
||||
+ " -\n" + "\n" + ChatColor.RESET + quest.getDescription() + "\n";
|
||||
for (final String msg : s.split("<br>")) {
|
||||
|
@ -99,7 +99,7 @@ public class NpcOfferQuestPrompt extends StringPrompt {
|
||||
} else {
|
||||
final Player player = quester.getPlayer();
|
||||
if (quester.canAcceptOffer(q, true)) {
|
||||
quester.setQuestToTake(q.getName());
|
||||
quester.setQuestIdToTake(q.getId());
|
||||
for (final String msg : extracted(plugin, quester).split("<br>")) {
|
||||
player.sendMessage(msg);
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public class NpcListener implements Listener {
|
||||
if (npcQuests.isEmpty() == false && npcQuests.size() == 1) {
|
||||
final Quest q = npcQuests.get(0);
|
||||
if (quester.canAcceptOffer(q, true)) {
|
||||
quester.setQuestToTake(q.getName());
|
||||
quester.setQuestIdToTake(q.getId());
|
||||
if (!plugin.getSettings().canAskConfirmation()) {
|
||||
quester.takeQuest(q, false);
|
||||
} else {
|
||||
|
@ -336,7 +336,7 @@ public class PlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
quester.setQuestToTake(q.getName());
|
||||
quester.setQuestIdToTake(q.getId());
|
||||
if (!plugin.getSettings().canAskConfirmation()) {
|
||||
quester.takeQuest(q, false);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user