Added Spawner Lock Command, And Formatted Grace Differently
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdSpawnerLock extends FCommand {
|
||||
|
||||
public CmdSpawnerLock(){
|
||||
super();
|
||||
this.aliases.add("lockspawners");
|
||||
this.aliases.add("spawnerlock");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.LOCKSPAWNERS)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context){
|
||||
Conf.spawnerLock = !Conf.spawnerLock;
|
||||
context.msg(TL.COMMAND_SPAWNER_LOCK_TOGGLED, Conf.spawnerLock ? FactionsPlugin.getInstance().color("&aEnabled") : FactionsPlugin.getInstance().color("&4Disabled"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_SPAWNER_LOCK_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
@@ -146,6 +146,7 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
||||
public CmdCheck cmdCheck = new CmdCheck();
|
||||
public CmdWeeWoo cmdWeeWoo = new CmdWeeWoo();
|
||||
public CmdConvertConfig cmdConvertConfig = new CmdConvertConfig();
|
||||
public CmdSpawnerLock cmdSpawnerLock = new CmdSpawnerLock();
|
||||
|
||||
public FCmdRoot() {
|
||||
super();
|
||||
@@ -255,6 +256,7 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
||||
this.addSubCommand(this.cmdFGlobal);
|
||||
this.addSubCommand(this.cmdViewChest);
|
||||
this.addSubCommand(this.cmdConvertConfig);
|
||||
this.addSubCommand(this.cmdSpawnerLock);
|
||||
|
||||
if (Conf.useCheckSystem) {
|
||||
this.addSubCommand(this.cmdCheck);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.grace;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.CommandContext;
|
||||
import com.massivecraft.factions.cmd.CommandRequirements;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
@@ -21,7 +22,7 @@ public class CmdGrace extends FCommand {
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Conf.gracePeriod = !Conf.gracePeriod;
|
||||
context.msg(TL.COMMAND_GRACE_TOGGLE, Conf.gracePeriod ? TL.GENERIC_ENABLED : TL.GENERIC_DISABLED);
|
||||
context.msg(TL.COMMAND_GRACE_TOGGLE, Conf.gracePeriod ? FactionsPlugin.getInstance().color("&aEnabled") : FactionsPlugin.getInstance().color("&4Disabled"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user