2020-07-21 03:17:08 +00:00
|
|
|
package xyz.etztech.orealert;
|
|
|
|
|
|
|
|
|
|
|
|
import net.md_5.bungee.api.ChatColor;
|
|
|
|
import net.md_5.bungee.api.chat.TextComponent;
|
2020-07-28 02:06:33 +00:00
|
|
|
import org.apache.commons.lang.WordUtils;
|
|
|
|
import org.bukkit.Material;
|
2020-07-21 03:17:08 +00:00
|
|
|
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);
|
|
|
|
}
|
2020-07-28 02:06:33 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
2020-07-21 03:17:08 +00:00
|
|
|
}
|