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),
|
2020-07-29 04:30:41 +00:00
|
|
|
PLUGIN_RELOADED("Plugin reloaded.", Color.INFO),
|
|
|
|
ALERT("%s has found %d %s veins.", null);
|
2020-07-21 03:17:08 +00:00
|
|
|
|
|
|
|
private final String message;
|
|
|
|
private final ChatColor color;
|
|
|
|
|
|
|
|
Lang(String message, ChatColor color) {
|
|
|
|
this.message = message;
|
|
|
|
this.color = color;
|
|
|
|
}
|
|
|
|
|
2020-07-29 04:30:41 +00:00
|
|
|
public String getMessage() {
|
|
|
|
return this.message;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ChatColor getColor() {
|
|
|
|
return this.color;
|
|
|
|
}
|
|
|
|
|
2020-07-21 03:17:08 +00:00
|
|
|
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("_", " ");
|
2020-07-29 04:30:41 +00:00
|
|
|
name = WordUtils.capitalize(name.toLowerCase());
|
2020-07-28 02:06:33 +00:00
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String getMaterialKey(Material material) {
|
|
|
|
return material.name().toLowerCase();
|
|
|
|
}
|
2020-07-21 03:17:08 +00:00
|
|
|
}
|