ChestShop-3/com/Acrobot/Breeze/Utils/MessageUtil.java
Acrobot 5908eb67fa - Added API (let's start with simple things first)
- Copied utilities from ChestShop-4
- Made code really, really nicer to read
- Made every external plugin's wrapper a listener, so it listens to events instead of being hard-coded.
2012-06-08 15:28:36 +02:00

31 lines
738 B
Java

package com.Acrobot.Breeze.Utils;
import com.Acrobot.ChestShop.Config.Config;
import com.Acrobot.ChestShop.Config.Language;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* @author Acrobot
*/
public class MessageUtil {
public static void sendMessage(CommandSender sender, Language message) {
String toSend = Config.getLocal(message);
sender.sendMessage(toSend);
}
public static boolean sendMessage(String playerName, Language message) {
Player player = Bukkit.getPlayer(playerName);
if (player != null) {
sendMessage(player, message);
} else {
return false;
}
return true;
}
}