diff --git a/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java b/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java index 4a52bf78d..7a543c733 100644 --- a/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java +++ b/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java @@ -6,6 +6,8 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.World; @@ -76,7 +78,8 @@ public class SettingsTab implements Tab, ClickHandler { protected List getFlags() { // Get a list of flags of the correct type and sort by the translated names List flags = plugin.getFlagsManager().getFlags().stream().filter(f -> f.getType().equals(type)) - .sorted(Comparator.comparing(flag -> user.getTranslation(flag.getNameReference()))) + // We're stripping colors to avoid weird sorting issues + .sorted(Comparator.comparing(flag -> ChatColor.stripColor(user.getTranslation(flag.getNameReference())))) .collect(Collectors.toList()); // Remove any that are not for this game mode plugin.getIWM().getAddon(world).ifPresent(gm -> flags.removeIf(f -> !f.getGameModes().isEmpty() && !f.getGameModes().contains(gm)));