Don't even load /f fly if its set to false in config.
This commit is contained in:
parent
587182478b
commit
026b33b427
@ -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());
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user