Factions3/src/main/java/com/massivecraft/factions/cmd/req/ReqBankCommandsEnabled.java

43 lines
1.3 KiB
Java
Raw Normal View History

package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.UConf;
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;
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
2014-06-04 14:02:23 +02:00
public boolean apply(CommandSender sender, MassiveCommand command)
{
return UConf.get(sender).econEnabled && UConf.get(sender).bankEnabled;
}
@Override
2014-06-04 14:02:23 +02:00
public String createErrorMessage(CommandSender sender, MassiveCommand command)
{
2013-04-26 08:02:32 +02:00
UConf uconf = UConf.get(sender);
if (!uconf.bankEnabled)
{
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-26 08:02:32 +02:00
return Txt.parse("<b>Faction economy features are disabled in the <h>%s <b>universe.", uconf.getUniverse());
}
}