use of com.earth2me.essentials.CommandSource in project Essentials by drtshock.
the class Commandbroadcastworld method sendToWorld.
private void sendToWorld(World world, String message) {
IText broadcast = new SimpleTextInput(message);
final Collection<Player> players = ess.getOnlinePlayers();
for (Player player : players) {
if (player.getWorld().equals(world)) {
final User user = ess.getUser(player);
broadcast = new KeywordReplacer(broadcast, new CommandSource(player), ess, false);
for (String messageText : broadcast.getLines()) {
user.sendMessage(messageText);
}
}
}
}
Aggregations