From 1157607397ad1d41327b876a6c58ce660ae4b5c2 Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Fri, 22 Mar 2019 16:13:07 +0100 Subject: [PATCH] Readd /f promote and /f demote closing #13 --- .../factions/cmd/CmdFactions.java | 8 +++- .../factions/cmd/CmdFactionsRankOld.java | 48 +++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java diff --git a/src/com/massivecraft/factions/cmd/CmdFactions.java b/src/com/massivecraft/factions/cmd/CmdFactions.java index f876e9ce..10594fcd 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactions.java +++ b/src/com/massivecraft/factions/cmd/CmdFactions.java @@ -63,7 +63,7 @@ public class CmdFactions extends FactionsCommand public CmdFactionsMoneyconvert cmdFactionsMoneyconvert = new CmdFactionsMoneyconvert(); public CmdFactionsConfig cmdFactionsConfig = new CmdFactionsConfig(); public CmdFactionsClean cmdFactionsClean = new CmdFactionsClean(); - public MassiveCommandVersion cmdFactionsVersion = new MassiveCommandVersion(Factions.get()).addRequirements(RequirementHasPerm.get(Perm.VERSION)); + public MassiveCommandVersion cmdFactionsVersion = new MassiveCommandVersion(Factions.get()); // -------------------------------------------- // // CONSTRUCT @@ -71,8 +71,12 @@ public class CmdFactions extends FactionsCommand public CmdFactions() { + // Old rank stuff + this.addChild(new CmdFactionsRankOld("demote")); + this.addChild(new CmdFactionsRankOld("promote")); + // Deprecated Commands - this.addChild(new MassiveCommandDeprecated(this.cmdFactionsRank, "leader", "owner", "officer", "moderator", "demote", "promote")); + this.addChild(new MassiveCommandDeprecated(this.cmdFactionsRank, "leader", "owner", "officer", "moderator", "coleader")); this.addChild(new MassiveCommandDeprecated(this.cmdFactionsWarp, "home")); this.addChild(new MassiveCommandDeprecated(this.cmdFactionsWarp.cmdFactionWarpAdd, "sethome")); this.addChild(new MassiveCommandDeprecated(this.cmdFactionsWarp.cmdFactionWarpRemove, "unsethome")); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java new file mode 100644 index 00000000..6ebc9a88 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java @@ -0,0 +1,48 @@ +package com.massivecraft.factions.cmd; + +import com.massivecraft.factions.cmd.type.TypeMPlayer; +import com.massivecraft.massivecore.command.Visibility; +import com.massivecraft.massivecore.util.MUtil; + +public class CmdFactionsRankOld extends FactionsCommand +{ + // -------------------------------------------- // + // FIELDS + // -------------------------------------------- // + + public final String rankName; + + // -------------------------------------------- // + // CONSTRUCT + // -------------------------------------------- // + + public CmdFactionsRankOld(String rank) + { + // Fields + this.rankName = rank.toLowerCase(); + this.setSetupEnabled(false); + + // Aliases + this.addAliases(rankName); + + // Parameters + this.addParameter(TypeMPlayer.get(), "player"); + + // Visibility + this.setVisibility(Visibility.INVISIBLE); + } + + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public void perform() + { + CmdFactions.get().cmdFactionsRank.cmdFactionsRankSet.execute(sender, MUtil.list( + this.argAt(0), + this.rankName + )); + } + +} \ No newline at end of file