2019-05-23 02:12:46 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.Conf;
|
2019-06-29 03:49:46 +02:00
|
|
|
import com.massivecraft.factions.SaberFactions;
|
2019-05-23 02:12:46 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdGrace extends FCommand {
|
|
|
|
|
|
|
|
public CmdGrace() {
|
|
|
|
super();
|
|
|
|
this.aliases.add("grace");
|
|
|
|
|
|
|
|
this.permission = Permission.GRACE.node;
|
|
|
|
this.disableOnLock = false;
|
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = false;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeColeader = false;
|
|
|
|
senderMustBeAdmin = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
2019-06-29 03:49:46 +02:00
|
|
|
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) {
|
2019-05-23 02:12:46 +02:00
|
|
|
fme.msg(TL.GENERIC_DISABLED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
boolean gracePeriod = Conf.gracePeriod;
|
|
|
|
|
|
|
|
if (args.size() == 0) {
|
|
|
|
if (gracePeriod)
|
|
|
|
Conf.gracePeriod = false;
|
|
|
|
else
|
|
|
|
Conf.gracePeriod = true;
|
|
|
|
}
|
|
|
|
fme.msg(TL.COMMAND_GRACE_TOGGLE, gracePeriod ? "enabled" : "disabled");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_GRACE_DESCRIPTION;
|
|
|
|
}
|
|
|
|
}
|