package xyz.etztech.orealert; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.chat.TextComponent; import org.apache.commons.lang.WordUtils; import org.bukkit.Material; import org.bukkit.command.CommandSender; public enum Lang { NO_PERMISSION("You don't have permission to do that.", Color.ERROR), UNKNOWN_COMMAND("This command wasn't recognized.", Color.ERROR), PLUGIN_RELOADED("Plugin reloaded.", Color.INFO); private final String message; private final ChatColor color; Lang(String message, ChatColor color) { this.message = message; this.color = color; } public void sms(CommandSender sender) { TextComponent text = new TextComponent(this.message); text.setColor(this.color); sender.spigot().sendMessage(text); } public static String getMaterialName(Material material) { String name = material.name(); name = name.replaceAll("_", " "); name = WordUtils.capitalize(name); return name; } public static String getMaterialKey(Material material) { return material.name().toLowerCase(); } }