2013-04-16 12:04:12 +02:00
|
|
|
package com.massivecraft.factions.cmd.req;
|
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
2013-04-24 08:39:26 +02:00
|
|
|
import com.massivecraft.factions.entity.UConf;
|
2013-04-16 12:04:12 +02:00
|
|
|
import com.massivecraft.mcore.cmd.MCommand;
|
|
|
|
import com.massivecraft.mcore.cmd.req.ReqAbstract;
|
|
|
|
import com.massivecraft.mcore.util.Txt;
|
|
|
|
|
|
|
|
public class ReqBankCommandsEnabled extends ReqAbstract
|
|
|
|
{
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// INSTANCE & CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
private static ReqBankCommandsEnabled i = new ReqBankCommandsEnabled();
|
|
|
|
public static ReqBankCommandsEnabled get() { return i; }
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean apply(CommandSender sender, MCommand command)
|
|
|
|
{
|
2013-04-24 08:39:26 +02:00
|
|
|
return UConf.get(sender).econEnabled && UConf.get(sender).bankEnabled;
|
2013-04-16 12:04:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String createErrorMessage(CommandSender sender, MCommand command)
|
|
|
|
{
|
2013-04-26 08:02:32 +02:00
|
|
|
UConf uconf = UConf.get(sender);
|
|
|
|
if (!uconf.bankEnabled)
|
2013-04-16 12:04:12 +02:00
|
|
|
{
|
2013-04-26 08:02:32 +02:00
|
|
|
return Txt.parse("<b>Faction banks are disabled in the <h>%s <b>universe.", uconf.getUniverse());
|
2013-04-16 12:04:12 +02:00
|
|
|
}
|
2013-04-26 08:02:32 +02:00
|
|
|
return Txt.parse("<b>Faction economy features are disabled in the <h>%s <b>universe.", uconf.getUniverse());
|
2013-04-16 12:04:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|