package me.sharpjaws.sharpSK.hooks.mcMMO;

import javax.annotation.Nullable;

import org.bukkit.event.Event;

import com.gmail.nossr50.api.PartyAPI;

import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.util.Kleenean;


 public class CondmcMMOPartyHasAlly extends Condition
 {
 private Expression<String> s;




 @SuppressWarnings("unchecked")
	@Override
	public boolean init(Expression<?>[] expr, int matchedPattern, Kleenean arg2, SkriptParser.ParseResult arg3)
{
s = (Expression<String>) expr[0];

 return true;
 }


@Override
	public String toString(@Nullable Event e, boolean debug)
 {
 return "%player% is [in] same party as %player%";
}


@Override
	public boolean check(Event e)
 {

 return PartyAPI.hasAlly(s.getSingle(e));
}
}
