Merging branches 1 new mission type
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.massivecraft.factions.cmd.grace;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.cmd.CommandContext;
|
||||
import com.massivecraft.factions.cmd.CommandRequirements;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -9,37 +10,24 @@ 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;
|
||||
this.requirements = new CommandRequirements.Builder(Permission.GRACE)
|
||||
.playerOnly()
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!P.p.getConfig().getBoolean("f-grace.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
boolean gracePeriod = Conf.gracePeriod;
|
||||
|
||||
if (args.size() == 0) {
|
||||
Conf.gracePeriod = !gracePeriod;
|
||||
}
|
||||
fme.msg(TL.COMMAND_GRACE_TOGGLE, gracePeriod ? "enabled" : "disabled");
|
||||
public void perform(CommandContext context) {
|
||||
Conf.gracePeriod = !Conf.gracePeriod;
|
||||
context.msg(TL.COMMAND_GRACE_TOGGLE, Conf.gracePeriod ? TL.GENERIC_ENABLED : TL.GENERIC_DISABLED);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_GRACE_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user