bed-wars/src/main/java/rip/tilly/bedwars/utils/CC.java

47 lines
1.4 KiB
Java
Raw Normal View History

2021-11-21 14:00:21 +00:00
package rip.tilly.bedwars.utils;
import org.bukkit.ChatColor;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Lucanius
* Project: BedWars
*/
public class CC {
public static final String scoreboardBar = ChatColor.GRAY.toString() + ChatColor.STRIKETHROUGH + "----------------------";
public static final String chatBar = ChatColor.GRAY.toString() + ChatColor.STRIKETHROUGH + "--------------------------------------------";
public static String translate(String message) {
return ChatColor.translateAlternateColorCodes('&', message);
}
public static List<String> translate(List<String> lines) {
List<String> strings = new ArrayList<>();
for (String line : lines) {
strings.add(ChatColor.translateAlternateColorCodes('&', line));
}
return strings;
}
public static List<String> translate(String[] lines) {
List<String> strings = new ArrayList<>();
for (String line : lines) {
if (line != null) {
strings.add(ChatColor.translateAlternateColorCodes('&', line));
}
}
return strings;
}
2021-11-21 14:50:15 +00:00
public static boolean isNumeric(String string) {
return regexNumeric(string).length() == 0;
}
public static String regexNumeric(String string) {
return string.replaceAll("[0-9]", "").replaceFirst("\\.", "");
}
2021-11-21 14:00:21 +00:00
}