2013-04-17 13:16:22 +02:00
|
|
|
package com.massivecraft.factions;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
2013-04-22 17:59:51 +02:00
|
|
|
import com.massivecraft.factions.entity.UPlayer;
|
2013-04-22 09:37:53 +02:00
|
|
|
import com.massivecraft.factions.entity.Faction;
|
2014-06-04 14:02:23 +02:00
|
|
|
import com.massivecraft.massivecore.Predictate;
|
2013-04-17 13:16:22 +02:00
|
|
|
|
|
|
|
public class FactionEqualsPredictate implements Predictate<CommandSender>, Serializable
|
|
|
|
{
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// FIELDS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
private final String factionId;
|
|
|
|
public String getFactionId() { return this.factionId; }
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public FactionEqualsPredictate(Faction faction)
|
|
|
|
{
|
|
|
|
this.factionId = faction.getId();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean apply(CommandSender sender)
|
|
|
|
{
|
2013-04-22 19:57:11 +02:00
|
|
|
UPlayer uplayer = UPlayer.get(sender);
|
|
|
|
return this.factionId.equals(uplayer.getFactionId());
|
2013-04-17 13:16:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|