Optionally display the award title.

This commit is contained in:
ApacheZy 2021-03-14 23:57:23 +08:00
parent 9e374f2970
commit 269f93f5c9
1 changed files with 7 additions and 3 deletions

View File

@ -514,10 +514,14 @@ public abstract class CommonGUI
// Show a title to the rewards
// If there is no reward text, do not display title
String rewardText = isCompletedOnce ? challenge.getRepeatRewardText() : challenge.getRewardText();
if (rewardText != null && !ChatColor.stripColor(rewardText).isEmpty())
if (rewardText != null)
{
result.add(this.user.getTranslation("challenges.gui.challenge-description.rewards-title"));
result.add(rewardText);
String testText = ChatColor.translateAlternateColorCodes('&', rewardText);
if (!ChatColor.stripColor(testText.replaceAll("[\\r\\n]", "")).isEmpty())
{
result.add(this.user.getTranslation("challenges.gui.challenge-description.rewards-title"));
result.add(rewardText);
}
}
}
break;