Suggest new command on using old command.

This commit is contained in:
Olof Larsson 2014-10-14 08:03:05 +02:00
parent 8d31a0d4a0
commit 2c08c1a32c
3 changed files with 53 additions and 1 deletions

View File

@ -93,6 +93,14 @@ public class CmdFactions extends FactionsCommand
this.addSubCommand(this.cmdFactionsAdmin);
this.addSubCommand(this.cmdFactionsPowerBoost);
this.addSubCommand(this.cmdFactionsVersion);
// Deprecated Commands
this.addSubCommand(new CmdFactionsXDeprecated(this.cmdFactionsSet, "claim"));
this.addSubCommand(new CmdFactionsXDeprecated(this.cmdFactionsSet, "unclaim"));
this.addSubCommand(new CmdFactionsXDeprecated(this.cmdFactionsSet, "autoclaim"));
this.addSubCommand(new CmdFactionsXDeprecated(this.cmdFactionsSet, "unclaimall"));
this.addSubCommand(new CmdFactionsXDeprecated(this.cmdFactionsFaction, "show", "who"));
}
// -------------------------------------------- //

View File

@ -36,7 +36,6 @@ public class CmdFactionsSet extends FactionsCommand
this.addSubCommand(this.cmdFactionsSetTransfer);
// Requirements
this.addRequirements(ReqIsPlayer.get());
this.addRequirements(ReqHasPerm.get(Perm.SET.node));
}

View File

@ -0,0 +1,45 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.massivecore.cmd.MassiveCommand;
import com.massivecraft.massivecore.cmd.VisibilityMode;
public class CmdFactionsXDeprecated extends FactionsCommand
{
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
public MassiveCommand target;
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsXDeprecated(MassiveCommand target, String... aliases)
{
// Fields
this.target = target;
// Aliases
this.addAliases(aliases);
// Args
this.setErrorOnToManyArgs(false);
// Visibility
this.setVisibilityMode(VisibilityMode.INVISIBLE);
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
{
msg("<i>Use this new command instead:");
sendMessage(target.getUseageTemplate(true));
}
}