export class StringUtils {
    static toTitleCaseEntityName(string) {
        if (!string || typeof string !== 'string')
            return "Unknown";
        let id = string.split(":")[1] || string; // Se não há ":", usa a string toda
        id = id.replace(/_/g, " ");
        id = id.split(" ").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
        return id;
    }
    static toLowerCaseEntityName(string) {
        if (!string)
            return "Unknown";
        let id = string.split(":")[1];
        id = id.replace(/_/g, " ");
        id = id.split(" ").map(word => word.charAt(0).toLowerCase() + word.slice(1)).join(" ");
        return id;
    }
    static formatName(name) {
        if (!name)
            return "Unknown";
        let id = name.split(":")[1];
        id = id.replace("_spawn_egg", "");
        id = id.replace(/_/g, " ");
        id = id.split(" ").map(word => word.charAt(0).toLowerCase() + word.slice(1)).join(" ");
        id = id.replace(" ", "");
        return id;
    }
    static formatAttackName(attack) {
        if (!attack)
            return "Unknown";
        let id = attack;
        if (id.includes(":")) {
            id = id.split(":")[1];
        }
        id = id.replace(/_/g, " ");
        id = id.split(" ").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
        return id;
    }
    static formatEntityFull(typeId) {
        if (!typeId)
            return "Unknown";
        if (typeId.includes(":")) {
            typeId = typeId.split(":")[1];
        }
        typeId = typeId.replace(/_/g, " ");
        typeId = typeId.split(" ").map(word => word.charAt(0).toLowerCase() + word.slice(1)).join(" ");
        typeId = typeId.replace(" ", "");
        typeId = typeId.replace("pr:", "");
        return typeId;
    }
}
