Merge pull request #396 from christophe6/master

- PlaceholderAPI for start/end messages, switched obj. and start msg.
This commit is contained in:
FlyingPikachu 2018-05-10 16:38:39 -04:00 committed by GitHub
commit 7df24e079f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,6 +98,9 @@ public class Quest {
public void nextStage(Quester q) {
String stageCompleteMessage = q.getCurrentStage(this).completeMessage;
if (stageCompleteMessage != null) {
if(Quests.placeholder != null) {
s = PlaceholderAPI.setPlaceholders(quester.getPlayer(), s);
}
q.getPlayer().sendMessage(Quests.parseString(stageCompleteMessage, this));
}
if (plugin.useCompass) {
@ -153,16 +156,19 @@ public class Quest {
nextStage.startEvent.fire(quester, this);
}
updateCompass(quester, nextStage);
String stageStartMessage = quester.getCurrentStage(this).startMessage;
if (stageStartMessage != null) {
quester.getPlayer().sendMessage(Quests.parseString(stageStartMessage, this));
}
String msg = Lang.get(quester.getPlayer(), "questObjectivesTitle");
msg = msg.replaceAll("<quest>", name);
quester.getPlayer().sendMessage(ChatColor.GOLD + msg);
for (String s : quester.getObjectivesReal(this)) {
if(Quests.placeholder != null) {
s = PlaceholderAPI.setPlaceholders(quester.getPlayer(), s);
}
quester.getPlayer().sendMessage(s);
}
String stageStartMessage = quester.getCurrentStage(this).startMessage;
if (stageStartMessage != null) {
quester.getPlayer().sendMessage(Quests.parseString(stageStartMessage, this));
}
quester.updateJournal();
}