Support PlaceholderAPI variables in objective-overrides, per #980

This commit is contained in:
PikaMug 2019-11-08 15:16:27 -05:00
parent fd04e25976
commit 2c5f09dec8
2 changed files with 9 additions and 1 deletions

View File

@ -2082,7 +2082,7 @@ public class Quester {
if (getCurrentStage(quest).objectiveOverride != null) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + getCurrentStage(quest)
.objectiveOverride;
p.sendMessage(message);
p.sendMessage(ConfigUtil.parseString(message, p));
} else if (objective.equalsIgnoreCase("password")) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + pass;
p.sendMessage(message);

View File

@ -151,6 +151,14 @@ public class ConfigUtil {
}
return parsed;
}
public static String parseString(String s, Player player) {
String parsed = parseString(s);
if (Dependencies.placeholder != null && player != null) {
parsed = PlaceholderAPI.setPlaceholders(player, parsed);
}
return parsed;
}
public static String parseString(String s, NPC npc) {
String parsed = parseString(s);