mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-14 06:36:34 +01:00
Fix issue when Color codes did not work in opened Panels and Titles (#110)
These text element colors were not translated correctly. Now it should work.
This commit is contained in:
parent
c702dd492b
commit
d60f20e394
@ -1,6 +1,7 @@
|
||||
package world.bentobox.challenges.panel.admin;
|
||||
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@ -275,7 +276,7 @@ public class EditLevelGUI extends CommonGUI
|
||||
private PanelItem createChallengeIcon(Challenge challenge)
|
||||
{
|
||||
return new PanelItemBuilder().
|
||||
name(challenge.getFriendlyName()).
|
||||
name(ChatColor.translateAlternateColorCodes('&', challenge.getFriendlyName())).
|
||||
description(GuiUtils.stringSplit(
|
||||
challenge.getDescription(),
|
||||
this.addon.getChallengesSettings().getLoreLineLength())).
|
||||
|
@ -1,6 +1,7 @@
|
||||
package world.bentobox.challenges.panel.admin;
|
||||
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import java.util.List;
|
||||
@ -133,7 +134,7 @@ public class ListChallengesGUI extends CommonGUI
|
||||
private PanelItem createChallengeIcon(Challenge challenge)
|
||||
{
|
||||
PanelItemBuilder itemBuilder = new PanelItemBuilder().
|
||||
name(challenge.getFriendlyName()).
|
||||
name(ChatColor.translateAlternateColorCodes('&', challenge.getFriendlyName())).
|
||||
description(GuiUtils.stringSplit(this.generateChallengeDescription(challenge, this.user.getPlayer()),
|
||||
this.addon.getChallengesSettings().getLoreLineLength())).
|
||||
icon(challenge.getIcon()).
|
||||
|
@ -1,6 +1,7 @@
|
||||
package world.bentobox.challenges.panel.admin;
|
||||
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import java.util.List;
|
||||
@ -133,7 +134,7 @@ public class ListLevelsGUI extends CommonGUI
|
||||
private PanelItem createLevelIcon(ChallengeLevel challengeLevel)
|
||||
{
|
||||
PanelItemBuilder itemBuilder = new PanelItemBuilder().
|
||||
name(challengeLevel.getFriendlyName()).
|
||||
name(ChatColor.translateAlternateColorCodes('&', challengeLevel.getFriendlyName())).
|
||||
description(GuiUtils.stringSplit(
|
||||
this.generateLevelDescription(challengeLevel, this.user.getPlayer()),
|
||||
this.addon.getChallengesSettings().getLoreLineLength())).
|
||||
|
@ -1,6 +1,7 @@
|
||||
package world.bentobox.challenges.panel.user;
|
||||
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -349,7 +350,9 @@ public class ChallengesGUI extends CommonGUI
|
||||
{
|
||||
return new PanelItemBuilder().
|
||||
icon(challenge.getIcon()).
|
||||
name(challenge.getFriendlyName().isEmpty() ? challenge.getUniqueId() : challenge.getFriendlyName()).
|
||||
name(challenge.getFriendlyName().isEmpty() ?
|
||||
challenge.getUniqueId() :
|
||||
ChatColor.translateAlternateColorCodes('&', challenge.getFriendlyName())).
|
||||
description(GuiUtils.stringSplit(this.generateChallengeDescription(challenge, this.user.getPlayer()),
|
||||
this.addon.getChallengesSettings().getLoreLineLength())).
|
||||
clickHandler((panel, user1, clickType, slot) -> {
|
||||
@ -440,7 +443,7 @@ public class ChallengesGUI extends CommonGUI
|
||||
|
||||
return new PanelItemBuilder().
|
||||
icon(icon).
|
||||
name(name).
|
||||
name(ChatColor.translateAlternateColorCodes('&', name)).
|
||||
description(description).
|
||||
glow(glow).
|
||||
clickHandler(clickHandler).
|
||||
|
@ -1,6 +1,7 @@
|
||||
package world.bentobox.challenges.panel.util;
|
||||
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import java.util.*;
|
||||
@ -144,7 +145,7 @@ public class SelectChallengeGUI
|
||||
|
||||
|
||||
return new PanelItemBuilder().
|
||||
name(challenge.getFriendlyName()).
|
||||
name(ChatColor.translateAlternateColorCodes('&', challenge.getFriendlyName())).
|
||||
description(GuiUtils.stringSplit(description, this.lineLength)).
|
||||
icon(challenge.getIcon()).
|
||||
clickHandler((panel, user1, clickType, slot) -> {
|
||||
|
@ -4,10 +4,7 @@
|
||||
package world.bentobox.challenges.tasks;
|
||||
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -1027,7 +1024,7 @@ public class TryToComplete
|
||||
outputMessage = outputMessage.replace("[rewardText]", challenge.getRewardText());
|
||||
}
|
||||
|
||||
return outputMessage;
|
||||
return ChatColor.translateAlternateColorCodes('&', outputMessage);
|
||||
}
|
||||
|
||||
|
||||
@ -1047,7 +1044,7 @@ public class TryToComplete
|
||||
outputMessage = outputMessage.replace("[rewardText]", level.getRewardText());
|
||||
}
|
||||
|
||||
return outputMessage;
|
||||
return ChatColor.translateAlternateColorCodes('&', outputMessage);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user