mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-30 12:11:37 +01:00
Support PlaceholderAPI variables in objective-overrides, per #980
This commit is contained in:
parent
fd04e25976
commit
2c5f09dec8
@ -2082,7 +2082,7 @@ public class Quester {
|
|||||||
if (getCurrentStage(quest).objectiveOverride != null) {
|
if (getCurrentStage(quest).objectiveOverride != null) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + getCurrentStage(quest)
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + getCurrentStage(quest)
|
||||||
.objectiveOverride;
|
.objectiveOverride;
|
||||||
p.sendMessage(message);
|
p.sendMessage(ConfigUtil.parseString(message, p));
|
||||||
} else if (objective.equalsIgnoreCase("password")) {
|
} else if (objective.equalsIgnoreCase("password")) {
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + pass;
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + pass;
|
||||||
p.sendMessage(message);
|
p.sendMessage(message);
|
||||||
|
@ -151,6 +151,14 @@ public class ConfigUtil {
|
|||||||
}
|
}
|
||||||
return parsed;
|
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) {
|
public static String parseString(String s, NPC npc) {
|
||||||
String parsed = parseString(s);
|
String parsed = parseString(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user