2013-04-25 13:53:22 +02:00
|
|
|
package com.massivecraft.factions.cmd.req;
|
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
2014-09-17 13:17:33 +02:00
|
|
|
import com.massivecraft.factions.entity.MPlayer;
|
2014-06-04 14:02:23 +02:00
|
|
|
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
|
|
|
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
|
|
|
import com.massivecraft.massivecore.util.Txt;
|
2013-04-25 13:53:22 +02:00
|
|
|
|
|
|
|
public class ReqHasntFaction extends ReqAbstract
|
|
|
|
{
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// INSTANCE & CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
private static ReqHasntFaction i = new ReqHasntFaction();
|
|
|
|
public static ReqHasntFaction get() { return i; }
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 14:02:23 +02:00
|
|
|
public boolean apply(CommandSender sender, MassiveCommand command)
|
2013-04-25 13:53:22 +02:00
|
|
|
{
|
2014-09-17 13:17:33 +02:00
|
|
|
return !MPlayer.get(sender).hasFaction();
|
2013-04-25 13:53:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 14:02:23 +02:00
|
|
|
public String createErrorMessage(CommandSender sender, MassiveCommand command)
|
2013-04-25 13:53:22 +02:00
|
|
|
{
|
|
|
|
return Txt.parse("<b>You must leave your current faction before you "+(command == null ? "do that" : command.getDesc())+".");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|