Add tax commands

This commit is contained in:
Magnus Ulf
2019-08-11 16:12:50 +02:00
parent 46cf009b01
commit cd3b846ae1
11 changed files with 491 additions and 61 deletions

View File

@@ -0,0 +1,40 @@
package com.massivecraft.factions.cmd.req;
import com.massivecraft.factions.task.TaskTax;
import com.massivecraft.massivecore.command.MassiveCommand;
import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
import com.massivecraft.massivecore.util.Txt;
import org.bukkit.command.CommandSender;
public class ReqTaxEnabled extends RequirementAbstract
{
// -------------------------------------------- //
// SERIALIZABLE
// -------------------------------------------- //
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReqTaxEnabled i = new ReqTaxEnabled();
public static ReqTaxEnabled get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MassiveCommand command)
{
return TaskTax.get().areConditionsMet();
}
@Override
public String createErrorMessage(CommandSender sender, MassiveCommand command)
{
return Txt.parse("<b>Tax is not enabled on this server.");
}
}