package com.yaohun.demonskills.config;

import org.bukkit.Sound;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class MessageUtil {

    public static void sendMessage(CommandSender sender, String message) {
        if(sender instanceof Player){
            Player player = (Player) sender;
            player.sendMessage(message);
        } else {
            sender.sendMessage(message);
        }
    }

    public static void sendMessage(CommandSender sender, String message, Sound sound) {
        if(sender instanceof Player){
            Player player = (Player) sender;
            player.sendMessage(message);
            player.playSound(player.getLocation(), sound, 0.5f, 1.2f);
        } else {
            sender.sendMessage(message);
        }
    }

}
