public class ChatUtil
{
public static void sendMsg(final Player p, final String msg) {
p.sendMessage(fixColor(msg).replace("{NICK}", p.getName()));
}
public static void sendMsgS(final CommandSender sender, final String msg) {
sender.sendMessage(fixColor(msg).replace("{NICK}", sender.getName()));
}
public static String fixColor(final String text) {
return text.replace(">>", "»").replace("<<", "«").replace("&", "§");
}
public static boolean isInteger(final String string) {
return Pattern.matches("-?[0-9]+", string.subSequence(0, string.length()));
}
public static String locToString(final double x, final double y, final double z) {
return String.valueOf(String.valueOf(x)) + ":" + y + ":" + z + ":" + 0.0f + ":" + 0.0f;
}
public static String locToString(final Location loc) {
return String.valueOf(String.valueOf(loc.getX())) + ":" + loc.getY() + ":" + loc.getZ() + ":" + loc.getYaw() + ":" + loc.getPitch();
}
public static Location locFromString(final String str) {
final String[] str2loc = str.split(":");
final Location loc = new Location((World)Bukkit.getWorlds().get(0), 0.0, 0.0, 0.0, 0.0f, 0.0f);
loc.setX(Double.parseDouble(str2loc[0]));
loc.setY(Double.parseDouble(str2loc[1]));
loc.setZ(Double.parseDouble(str2loc[2]));
loc.setYaw(Float.parseFloat(str2loc[3]));
loc.setPitch(Float.parseFloat(str2loc[4]));
return loc;
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}