Added broadcast method

This commit is contained in:
extendedclip 2018-06-16 19:57:22 -04:00
parent 287ab16d3a
commit 0f51b4f2a5

View File

@ -20,18 +20,22 @@
*/
package me.clip.placeholderapi.util;
import java.util.Arrays;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import java.util.Arrays;
public class Msg {
public static void msg(CommandSender s, String... msg) {
Arrays.stream(msg).map(Msg::color).forEach(s::sendMessage);
}
public static void msg(CommandSender s, String... msg) {
Arrays.stream(msg).map(Msg::color).forEach(s::sendMessage);
}
public static String color(String text) {
return ChatColor.translateAlternateColorCodes('&', text);
}
public static void broadcast(String... msg) {
Arrays.stream(msg).map(Msg::color).forEach(Bukkit::broadcastMessage);
}
public static String color(String text) {
return ChatColor.translateAlternateColorCodes('&', text);
}
}