mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-22 17:17:38 +01:00
Allow color codes and tags in objective-overrides, part 2. Per #1047
This commit is contained in:
parent
2dea1eeebb
commit
b352adda94
@ -578,7 +578,13 @@ public class Quester {
|
|||||||
if (getCurrentStage(quest) != null) {
|
if (getCurrentStage(quest) != null) {
|
||||||
if (getCurrentStage(quest).objectiveOverride != null) {
|
if (getCurrentStage(quest).objectiveOverride != null) {
|
||||||
LinkedList<String> objectives = new LinkedList<String>();
|
LinkedList<String> objectives = new LinkedList<String>();
|
||||||
objectives.add(ChatColor.GREEN + getCurrentStage(quest).objectiveOverride);
|
String message = ChatColor.GREEN + ConfigUtil.parseString(
|
||||||
|
ChatColor.translateAlternateColorCodes('&', getCurrentStage(quest).objectiveOverride),
|
||||||
|
quest, getPlayer());
|
||||||
|
if (plugin.getDependencies().getPlaceholderApi() != null) {
|
||||||
|
message = PlaceholderAPI.setPlaceholders(getPlayer(), message);
|
||||||
|
}
|
||||||
|
objectives.add(message);
|
||||||
return objectives;
|
return objectives;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2073,8 +2079,9 @@ public class Quester {
|
|||||||
String pass, CustomObjective co) {
|
String pass, CustomObjective co) {
|
||||||
Player p = getPlayer();
|
Player p = getPlayer();
|
||||||
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") + ") "
|
||||||
.objectiveOverride;
|
+ ConfigUtil.parseString(ChatColor.translateAlternateColorCodes('&',
|
||||||
|
getCurrentStage(quest).objectiveOverride), quest, p);
|
||||||
if (plugin.getDependencies().getPlaceholderApi() != null) {
|
if (plugin.getDependencies().getPlaceholderApi() != null) {
|
||||||
message = PlaceholderAPI.setPlaceholders(p, message);
|
message = PlaceholderAPI.setPlaceholders(p, message);
|
||||||
}
|
}
|
||||||
|
@ -663,8 +663,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
}
|
}
|
||||||
if (!ignoreOverrides) {
|
if (!ignoreOverrides) {
|
||||||
if (quester.getCurrentStage(quest).objectiveOverride != null) {
|
if (quester.getCurrentStage(quest).objectiveOverride != null) {
|
||||||
String message = ChatColor.GREEN + ConfigUtil.parseString(ChatColor.GREEN
|
String message = ChatColor.GREEN + ConfigUtil.parseString(ChatColor.translateAlternateColorCodes('&',
|
||||||
+ ChatColor.translateAlternateColorCodes('&',
|
|
||||||
quester.getCurrentStage(quest).objectiveOverride), quest, quester.getPlayer());
|
quester.getCurrentStage(quest).objectiveOverride), quest, quester.getPlayer());
|
||||||
if (depends.getPlaceholderApi() != null) {
|
if (depends.getPlaceholderApi() != null) {
|
||||||
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
|
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
|
||||||
|
Loading…
Reference in New Issue
Block a user