mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-20 00:55:12 +01:00
5908eb67fa
- 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.
31 lines
738 B
Java
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;
|
|
}
|
|
}
|