// Path: src/main/java/com/nametagedit/plugin/utils/Utils.java
// public class Utils {
// 
//     private static final Pattern hexPattern = Pattern.compile("&#([A-Fa-f0-9]{6})");
// 
//     public static String format(String[] text, int to, int from) {
//         return StringUtils.join(text, ' ', to, from).replace("'", "");
//     }
// 
//     public static String deformat(String input) {
//         return ChatColor.stripColor(input);
//     }
// 
//     public static String format(String input) {
//         return format(input, false);
//     }
// 
//     public static String format(String input, boolean limitChars) {
//         String colored = color(input);
// 
//         switch (VersionChecker.getBukkitVersion()) {
//             case v1_13_R1: case v1_14_R1: case v1_14_R2: case v1_15_R1: case v1_16_R1:
//             case v1_16_R2: case v1_16_R3: case v1_17_R1:
//                 return limitChars && colored.length() > 256 ? colored.substring(0, 256) : colored;
//             default:
//                 return limitChars && colored.length() > 16 ? colored.substring(0, 16) : colored;
//         }
//     }
// 
//     public static String color(String text) {
//         if (text == null) return "";
// 
//         text = ChatColor.translateAlternateColorCodes('&', text);
// 
//         if (VersionChecker.canHex()) {
//             final char colorChar = ChatColor.COLOR_CHAR;
// 
//             final Matcher matcher = hexPattern.matcher(text);
//             final StringBuffer buffer = new StringBuffer(text.length() + 4 * 8);
// 
//             while (matcher.find()) {
//                 final String group = matcher.group(1);
// 
//                 matcher.appendReplacement(buffer, colorChar + "x"
//                         + colorChar + group.charAt(0) + colorChar + group.charAt(1)
//                         + colorChar + group.charAt(2) + colorChar + group.charAt(3)
//                         + colorChar + group.charAt(4) + colorChar + group.charAt(5));
//             }
// 
//             text = matcher.appendTail(buffer).toString();
//         }
// 
//         return text;
//     }
// 
//     public static List<Player> getOnline() {
//         List<Player> list = new ArrayList<>();
// 
//         for (World world : Bukkit.getWorlds()) {
//             list.addAll(world.getPlayers());
//         }
// 
//         return Collections.unmodifiableList(list);
//     }
// 
//     public static YamlConfiguration getConfig(File file) {
//         try {
//             if (!file.exists()) {
//                 file.createNewFile();
//             }
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
// 
//         return YamlConfiguration.loadConfiguration(file);
//     }
// 
//     public static YamlConfiguration getConfig(File file, String resource, Plugin plugin) {
//         try {
//             if (!file.exists()) {
//                 file.createNewFile();
//                 InputStream inputStream = plugin.getResource(resource);
//                 OutputStream outputStream = new FileOutputStream(file);
//                 byte[] buffer = new byte[1024];
//                 int bytesRead;
//                 while ((bytesRead = inputStream.read(buffer)) != -1) {
//                     outputStream.write(buffer, 0, bytesRead);
//                 }
//                 inputStream.close();
//                 outputStream.flush();
//                 outputStream.close();
//             }
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
// 
//         return YamlConfiguration.loadConfiguration(file);
//     }
// 
//     public static String generateUUID() {
//         String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//         StringBuilder builder = new StringBuilder();
//         for (int i = 0; i < 5; i++) {
//             builder.append(chars.charAt((int) (Math.random() * chars.length())));
//         }
//         return builder.toString();
//     }
// 
// }


import com.nametagedit.plugin.utils.Utils;
import lombok.AllArgsConstructor;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
package com.nametagedit.plugin;


@AllArgsConstructor
public enum NametagMessages {

    SET_PRIORITY("Set sort priority to %s for %s"),
    CLEARED_TEAMS("Empty teams: %s. Purge: %s."),
    DEBUG_TOGGLED("NametagEdit debug has been %s"),
    LONG_TAGS("Long Nametags has been %s"),
    GROUP_EXISTS("The group %s already exists"),
    GROUP_VALUE_CLEARED("Cleared the %s for the group %s"),
    GROUP_EXISTS_NOT("The group %s does not exist!"),
    GROUP_VALUE("Changed %s's %s to %s"),
    USAGE_CONVERT("Usage: /nte convert <file/db> <file/db> <legacy (true/false)>"),
    GROUP_REMOVED("Successfully removed group %s"),
    MODIFY_OWN_TAG("You can only modify your own tag."),
    NO_PERMISSION("You do not have permission to use this."),
    RELOADED_DATA("Successfully reloaded plugin data"),
    FILE_DOESNT_EXIST("The file %s does not exist"),
    UUID_LOOKUP_FAILED("Could not find the uuid for %s"),
    CREATED_GROUP("Created group %s"),
    NOT_A_NUMBER("Uh-oh! %s does not appear to be a number!"),
    FILE_MISCONFIGURED("The file %s is not properly configured. Please read the configuration guide, otherwise conversion will fail."),
    CONVERSION("Attempting to convert %s from %s to %s. (Legacy: %s)");

    private final String text;

    @Override
    public String toString() {
// Path: src/main/java/com/nametagedit/plugin/utils/Utils.java
// public class Utils {
// 
//     private static final Pattern hexPattern = Pattern.compile("&#([A-Fa-f0-9]{6})");
// 
//     public static String format(String[] text, int to, int from) {
//         return StringUtils.join(text, ' ', to, from).replace("'", "");
//     }
// 
//     public static String deformat(String input) {
//         return ChatColor.stripColor(input);
//     }
// 
//     public static String format(String input) {
//         return format(input, false);
//     }
// 
//     public static String format(String input, boolean limitChars) {
//         String colored = color(input);
// 
//         switch (VersionChecker.getBukkitVersion()) {
//             case v1_13_R1: case v1_14_R1: case v1_14_R2: case v1_15_R1: case v1_16_R1:
//             case v1_16_R2: case v1_16_R3: case v1_17_R1:
//                 return limitChars && colored.length() > 256 ? colored.substring(0, 256) : colored;
//             default:
//                 return limitChars && colored.length() > 16 ? colored.substring(0, 16) : colored;
//         }
//     }
// 
//     public static String color(String text) {
//         if (text == null) return "";
// 
//         text = ChatColor.translateAlternateColorCodes('&', text);
// 
//         if (VersionChecker.canHex()) {
//             final char colorChar = ChatColor.COLOR_CHAR;
// 
//             final Matcher matcher = hexPattern.matcher(text);
//             final StringBuffer buffer = new StringBuffer(text.length() + 4 * 8);
// 
//             while (matcher.find()) {
//                 final String group = matcher.group(1);
// 
//                 matcher.appendReplacement(buffer, colorChar + "x"
//                         + colorChar + group.charAt(0) + colorChar + group.charAt(1)
//                         + colorChar + group.charAt(2) + colorChar + group.charAt(3)
//                         + colorChar + group.charAt(4) + colorChar + group.charAt(5));
//             }
// 
//             text = matcher.appendTail(buffer).toString();
//         }
// 
//         return text;
//     }
// 
//     public static List<Player> getOnline() {
//         List<Player> list = new ArrayList<>();
// 
//         for (World world : Bukkit.getWorlds()) {
//             list.addAll(world.getPlayers());
//         }
// 
//         return Collections.unmodifiableList(list);
//     }
// 
//     public static YamlConfiguration getConfig(File file) {
//         try {
//             if (!file.exists()) {
//                 file.createNewFile();
//             }
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
// 
//         return YamlConfiguration.loadConfiguration(file);
//     }
// 
//     public static YamlConfiguration getConfig(File file, String resource, Plugin plugin) {
//         try {
//             if (!file.exists()) {
//                 file.createNewFile();
//                 InputStream inputStream = plugin.getResource(resource);
//                 OutputStream outputStream = new FileOutputStream(file);
//                 byte[] buffer = new byte[1024];
//                 int bytesRead;
//                 while ((bytesRead = inputStream.read(buffer)) != -1) {
//                     outputStream.write(buffer, 0, bytesRead);
//                 }
//                 inputStream.close();
//                 outputStream.flush();
//                 outputStream.close();
//             }
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
// 
//         return YamlConfiguration.loadConfiguration(file);
//     }
// 
//     public static String generateUUID() {
//         String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//         StringBuilder builder = new StringBuilder();
//         for (int i = 0; i < 5; i++) {
//             builder.append(chars.charAt((int) (Math.random() * chars.length())));
//         }
//         return builder.toString();
//     }
// 
// }


// Path: src/main/java/com/nametagedit/plugin/NametagMessages.java
import com.nametagedit.plugin.utils.Utils;
import lombok.AllArgsConstructor;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

package com.nametagedit.plugin;


@AllArgsConstructor
public enum NametagMessages {

    SET_PRIORITY("Set sort priority to %s for %s"),
    CLEARED_TEAMS("Empty teams: %s. Purge: %s."),
    DEBUG_TOGGLED("NametagEdit debug has been %s"),
    LONG_TAGS("Long Nametags has been %s"),
    GROUP_EXISTS("The group %s already exists"),
    GROUP_VALUE_CLEARED("Cleared the %s for the group %s"),
    GROUP_EXISTS_NOT("The group %s does not exist!"),
    GROUP_VALUE("Changed %s's %s to %s"),
    USAGE_CONVERT("Usage: /nte convert <file/db> <file/db> <legacy (true/false)>"),
    GROUP_REMOVED("Successfully removed group %s"),
    MODIFY_OWN_TAG("You can only modify your own tag."),
    NO_PERMISSION("You do not have permission to use this."),
    RELOADED_DATA("Successfully reloaded plugin data"),
    FILE_DOESNT_EXIST("The file %s does not exist"),
    UUID_LOOKUP_FAILED("Could not find the uuid for %s"),
    CREATED_GROUP("Created group %s"),
    NOT_A_NUMBER("Uh-oh! %s does not appear to be a number!"),
    FILE_MISCONFIGURED("The file %s is not properly configured. Please read the configuration guide, otherwise conversion will fail."),
    CONVERSION("Attempting to convert %s from %s to %s. (Legacy: %s)");

    private final String text;

    @Override
    public String toString() {
        return Utils.color("&8» &a" + text);