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

42 lines
1.2 KiB
Java
Raw Normal View History

package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.MConf;
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 MConf.get().econEnabled && MConf.get().bankEnabled;
}
@Override
2014-06-04 14:02:23 +02:00
public String createErrorMessage(CommandSender sender, MassiveCommand command)
{
if (!MConf.get().bankEnabled)
{
return Txt.parse("<b>Faction banks are disabled.");
}
return Txt.parse("<b>Faction economy features are disabled.");
}
}