package net.mc_pandacraft.java.plugin.pandacraftutils.plugin_interface;

import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils;

import org.bukkit.entity.Player;

import com.earth2me.essentials.Essentials;

public class EssentialsInterface {
	
	
	
	public static boolean isPlayerVanished(Player p) {
		try {
			return ((Essentials)PandacraftUtils.getInstance().getServer().getPluginManager().getPlugin("Essentials")).getUser(p).isVanished();
		} catch (Exception e) { }
		return false;
	}

	public static boolean canPlayerSeeVanishedPlayer(Player p, Player hiddenP) {
		try {
			Essentials ess = (Essentials)PandacraftUtils.getInstance().getServer().getPluginManager().getPlugin("Essentials");
			
			
			
			return ess.getUser(p).canSee(hiddenP);
		} catch (Exception e) { }
		return false;
	}

	public static boolean isPlayerMuted(Player p) {
		try {
			return ((Essentials)PandacraftUtils.getInstance().getServer().getPluginManager().getPlugin("Essentials")).getUser(p).isMuted();
		} catch (Exception e) { }
		return false;
	}
}
