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

38 lines
1.1 KiB
Java
Raw Normal View History

2014-09-18 13:41:20 +02:00
package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.cmd.MassiveCommand;
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
import com.massivecraft.massivecore.util.Txt;
public class ReqFactionHomesEnabled extends ReqAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReqFactionHomesEnabled i = new ReqFactionHomesEnabled();
public static ReqFactionHomesEnabled get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MassiveCommand command)
{
return MConf.get().homesEnabled;
}
@Override
public String createErrorMessage(CommandSender sender, MassiveCommand command)
{
return Txt.parse("<b>Homes must be enabled on the server to "+(command == null ? "do that" : command.getDesc())+".");
}
}