Don't even load /f fly if its set to false in config.

This commit is contained in:
Trent Hensler 2018-03-18 14:37:55 -07:00
parent 587182478b
commit 026b33b427
2 changed files with 8 additions and 7 deletions

View File

@ -22,12 +22,6 @@ public class CmdFly extends FCommand {
@Override @Override
public void perform() { public void perform() {
// Disabled by default.
if (!P.p.getConfig().getBoolean("enable-faction-flight", false)) {
fme.msg(TL.COMMAND_FLY_DISABLED);
return;
}
if (args.size() == 0) { if (args.size() == 0) {
if (!fme.canFlyAtLocation() && !fme.isFlying()) { if (!fme.canFlyAtLocation() && !fme.isFlying()) {
Faction factionAtLocation = Board.getInstance().getFactionAt(fme.getLastStoodAt()); Faction factionAtLocation = Board.getInstance().getFactionAt(fme.getLastStoodAt());

View File

@ -117,7 +117,6 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdDeinvite); this.addSubCommand(this.cmdDeinvite);
this.addSubCommand(this.cmdDescription); this.addSubCommand(this.cmdDescription);
this.addSubCommand(this.cmdDisband); this.addSubCommand(this.cmdDisband);
this.addSubCommand(this.cmdFly);
this.addSubCommand(this.cmdHelp); this.addSubCommand(this.cmdHelp);
this.addSubCommand(this.cmdHome); this.addSubCommand(this.cmdHome);
this.addSubCommand(this.cmdInvite); this.addSubCommand(this.cmdInvite);
@ -185,6 +184,14 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(new CmdSetMaxVaults()); this.addSubCommand(new CmdSetMaxVaults());
this.addSubCommand(new CmdVault()); this.addSubCommand(new CmdVault());
} }
if (P.p.getConfig().getBoolean("enable-faction-flight", false)) {
this.addSubCommand(this.cmdFly);
P.p.log(Level.INFO, "Enabling /f fly command");
} else {
P.p.log(Level.WARNING, "Faction flight set to false in config.yml. Not enabling /f fly command.");
}
} }
@Override @Override