From 22cb62910770ffb873bf5f9c1b339906a489b290 Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Wed, 6 May 2015 17:04:35 +0200 Subject: [PATCH] MassiveCore Change --- .../cmd/CmdFactionsAccessFaction.java | 8 ++--- .../factions/cmd/CmdFactionsAccessPlayer.java | 8 ++--- .../factions/cmd/CmdFactionsAdmin.java | 4 +-- .../factions/cmd/CmdFactionsCreate.java | 8 +++-- .../factions/cmd/CmdFactionsDescription.java | 9 ++--- .../factions/cmd/CmdFactionsDisband.java | 4 +-- .../factions/cmd/CmdFactionsFaction.java | 4 +-- .../factions/cmd/CmdFactionsFlagList.java | 4 +-- .../factions/cmd/CmdFactionsFlagSet.java | 12 +++---- .../factions/cmd/CmdFactionsFlagShow.java | 32 +++++------------ .../factions/cmd/CmdFactionsHome.java | 4 +-- .../factions/cmd/CmdFactionsInviteAdd.java | 7 ++-- .../factions/cmd/CmdFactionsInviteList.java | 8 ++--- .../factions/cmd/CmdFactionsInviteRemove.java | 10 ++---- .../factions/cmd/CmdFactionsJoin.java | 8 ++--- .../factions/cmd/CmdFactionsKick.java | 4 +-- .../factions/cmd/CmdFactionsList.java | 4 +-- .../factions/cmd/CmdFactionsMap.java | 6 ++-- .../factions/cmd/CmdFactionsMoneyBalance.java | 4 +-- .../factions/cmd/CmdFactionsMoneyDeposit.java | 8 ++--- .../cmd/CmdFactionsMoneyTransferFf.java | 12 +++---- .../cmd/CmdFactionsMoneyTransferFp.java | 12 +++---- .../cmd/CmdFactionsMoneyTransferPf.java | 12 +++---- .../cmd/CmdFactionsMoneyWithdraw.java | 8 ++--- .../factions/cmd/CmdFactionsMotd.java | 9 ++--- .../factions/cmd/CmdFactionsName.java | 10 +++--- .../factions/cmd/CmdFactionsPermList.java | 4 +-- .../factions/cmd/CmdFactionsPermSet.java | 16 ++++----- .../factions/cmd/CmdFactionsPermShow.java | 34 +++++-------------- .../factions/cmd/CmdFactionsPlayer.java | 4 +-- .../factions/cmd/CmdFactionsPowerBoost.java | 24 +++++++++---- .../factions/cmd/CmdFactionsRank.java | 32 ++++++++++------- .../factions/cmd/CmdFactionsRankOld.java | 8 +++-- .../cmd/CmdFactionsRelationAbstract.java | 4 +-- .../factions/cmd/CmdFactionsSeeChunk.java | 6 ++-- .../factions/cmd/CmdFactionsSetAll.java | 18 ++++++---- .../factions/cmd/CmdFactionsSetAuto.java | 4 +-- .../factions/cmd/CmdFactionsSetX.java | 4 +-- .../factions/cmd/CmdFactionsSetXAll.java | 9 ++--- .../factions/cmd/CmdFactionsSetXRadius.java | 8 ++--- .../factions/cmd/CmdFactionsSetXSimple.java | 4 ++- .../factions/cmd/CmdFactionsSethome.java | 4 +-- .../factions/cmd/CmdFactionsSetpower.java | 12 +++---- .../factions/cmd/CmdFactionsStatus.java | 12 +++---- .../factions/cmd/CmdFactionsTitle.java | 8 ++--- .../factions/cmd/CmdFactionsUnsethome.java | 4 +-- .../factions/cmd/CmdFactionsXPlaceholder.java | 2 +- .../factions/cmd/arg/ARFaction.java | 10 +++--- .../factions/cmd/arg/ARMFlag.java | 9 ++++- .../factions/cmd/arg/ARMPerm.java | 9 ++++- .../massivecraft/factions/cmd/arg/ARRank.java | 3 +- 51 files changed, 239 insertions(+), 232 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java index 33691fe4..1d181cd2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java @@ -21,8 +21,8 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract this.addAliases("f", "faction"); // Args - this.addRequiredArg("faction"); - this.addOptionalArg("yes/no", "toggle"); + this.addArg(ARFaction.get(), "faction"); + this.addArg(ARBoolean.get(), "yes/no", "toggle"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.ACCESS_FACTION.node)); @@ -36,8 +36,8 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract public void innerPerform() throws MassiveException { // Args - Faction faction = this.arg(0, ARFaction.get()); - Boolean newValue = this.arg(1, ARBoolean.get(), !ta.isFactionIdGranted(faction.getId())); + Faction faction = this.readArg(); + boolean newValue = this.readArg(!ta.isFactionIdGranted(faction.getId())); // MPerm if (!MPerm.getPermAccess().has(msender, hostFaction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java index 67547ff0..0632f43d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java @@ -21,8 +21,8 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract this.addAliases("p", "player"); // Args - this.addRequiredArg("player"); - this.addOptionalArg("yes/no", "toggle"); + this.addArg(ARMPlayer.getAny(), "player"); + this.addArg(ARBoolean.get(), "yes/no", "toggle"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.ACCESS_PLAYER.node)); @@ -36,8 +36,8 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract public void innerPerform() throws MassiveException { // Args - MPlayer mplayer = this.arg(0, ARMPlayer.getAny()); - Boolean newValue = this.arg(1, ARBoolean.get(), !ta.isPlayerIdGranted(mplayer.getId())); + MPlayer mplayer = this.readArg(); + boolean newValue = this.readArg(!ta.isPlayerIdGranted(mplayer.getId())); // MPerm if (!MPerm.getPermAccess().has(msender, hostFaction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java b/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java index bbf0a397..c4a22bbf 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java @@ -20,7 +20,7 @@ public class CmdFactionsAdmin extends FactionsCommand this.addAliases("admin"); // Args - this.addOptionalArg("on/off", "flip"); + this.addArg(ARBoolean.get(), "on/off", "flip"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.ADMIN.node)); @@ -34,7 +34,7 @@ public class CmdFactionsAdmin extends FactionsCommand public void perform() throws MassiveException { // Args - Boolean target = this.arg(0, ARBoolean.get(), !msender.isUsingAdminMode()); + boolean target = this.readArg(!msender.isUsingAdminMode()); // Apply msender.setUsingAdminMode(target); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java index 05ed79f6..8fdc4e8b 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java @@ -12,6 +12,8 @@ import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.event.EventFactionsCreate; import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; +import com.massivecraft.massivecore.MassiveException; +import com.massivecraft.massivecore.cmd.arg.ARString; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.store.MStore; @@ -27,7 +29,7 @@ public class CmdFactionsCreate extends FactionsCommand this.addAliases("create"); // Args - this.addRequiredArg("name"); + this.addArg(ARString.get(), "name"); // Requirements this.addRequirements(ReqHasntFaction.get()); @@ -39,10 +41,10 @@ public class CmdFactionsCreate extends FactionsCommand // -------------------------------------------- // @Override - public void perform() + public void perform() throws MassiveException { // Args - String newName = this.arg(0); + String newName = this.readArg(); // Verify if (FactionColl.get().isNameTaken(newName)) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java index 5bf0626e..a7188454 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java @@ -5,6 +5,8 @@ import com.massivecraft.factions.cmd.req.ReqHasFaction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsDescriptionChange; +import com.massivecraft.massivecore.MassiveException; +import com.massivecraft.massivecore.cmd.arg.ARString; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.mixin.Mixin; @@ -20,8 +22,7 @@ public class CmdFactionsDescription extends FactionsCommand this.addAliases("desc"); // Args - this.addRequiredArg("desc"); - this.setErrorOnToManyArgs(false); + this.addArg(ARString.get(), "desc", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node)); @@ -33,10 +34,10 @@ public class CmdFactionsDescription extends FactionsCommand // -------------------------------------------- // @Override - public void perform() + public void perform() throws MassiveException { // Args - String newDescription = this.argConcatFrom(0); + String newDescription = this.readArg(); // MPerm if ( ! MPerm.getPermDesc().has(msender, msenderFaction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java index 44b59dbb..e6e2d635 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java @@ -29,7 +29,7 @@ public class CmdFactionsDisband extends FactionsCommand this.addAliases("disband"); // Args - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.DISBAND.node)); @@ -43,7 +43,7 @@ public class CmdFactionsDisband extends FactionsCommand public void perform() throws MassiveException { // Args - Faction faction = this.arg(0, ARFaction.get(), msenderFaction); + Faction faction = this.readArg(msenderFaction); // MPerm if ( ! MPerm.getPermDisband().has(msender, faction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java b/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java index c2a9b155..ce1b54c2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java @@ -28,7 +28,7 @@ public class CmdFactionsFaction extends FactionsCommand this.addAliases("f", "faction"); // Args - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FACTION.node)); @@ -42,7 +42,7 @@ public class CmdFactionsFaction extends FactionsCommand public void perform() throws MassiveException { // Args - final Faction faction = this.arg(0, ARFaction.get(), msenderFaction); + final Faction faction = this.readArg(msenderFaction); final CommandSender sender = this.sender; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java index bb84e9fd..cb896a52 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java @@ -22,7 +22,7 @@ public class CmdFactionsFlagList extends FactionsCommand this.addAliases("l", "list"); // Args - this.addOptionalArg("page", "1"); + this.addArg(ARInteger.get(), "page", "1"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FLAG_LIST.node)); @@ -36,7 +36,7 @@ public class CmdFactionsFlagList extends FactionsCommand public void perform() throws MassiveException { // Args - Integer pageHumanBased = this.arg(0, ARInteger.get(), 1); + int pageHumanBased = this.readArg(1); //Create messages List messages = new ArrayList(); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java index dbbe66b1..21f606f9 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java @@ -23,9 +23,9 @@ public class CmdFactionsFlagSet extends FactionsCommand this.addAliases("set"); // Args - this.addRequiredArg("flag"); - this.addRequiredArg("yes/no"); - this.addOptionalArg("faction", "you"); + this.addArg(ARMFlag.get(), "flag"); + this.addArg(ARBoolean.get(), "yes/no"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FLAG_SET.node)); @@ -39,9 +39,9 @@ public class CmdFactionsFlagSet extends FactionsCommand public void perform() throws MassiveException { // Args - MFlag flag = this.arg(0, ARMFlag.get()); - Boolean value = this.arg(1, ARBoolean.get()); - Faction faction = this.arg(2, ARFaction.get(), msenderFaction); + MFlag flag = this.readArg(); + boolean value = this.readArg(); + Faction faction = this.readArg(msenderFaction); // Do the sender have the right to change flags for this faction? if ( ! MPerm.getPermFlags().has(msender, faction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java index 9e139b00..2c15ac58 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java @@ -1,6 +1,7 @@ package com.massivecraft.factions.cmd; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import com.massivecraft.factions.Perm; @@ -9,7 +10,8 @@ import com.massivecraft.factions.cmd.arg.ARMFlag; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARList; +import com.massivecraft.massivecore.cmd.arg.ARAll; +import com.massivecraft.massivecore.cmd.arg.ARSet; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -25,9 +27,8 @@ public class CmdFactionsFlagShow extends FactionsCommand this.addAliases("s", "show"); // Args - this.addOptionalArg("faction", "you"); - this.addOptionalArg("flags", "all"); - this.setErrorOnToManyArgs(false); + this.addArg(ARFaction.get(), "faction", "you"); + this.addArg(ARAll.get(ARSet.get(ARMFlag.get(), false)), "flags", "all", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FLAG_SHOW.node)); @@ -41,30 +42,13 @@ public class CmdFactionsFlagShow extends FactionsCommand public void perform() throws MassiveException { // Arg: Faction - Faction faction = this.arg(0, ARFaction.get(), msenderFaction); - - List flags = new ArrayList(); - - // Case: Show All - if ( ! this.argIsSet(1) || "all".equalsIgnoreCase(this.arg(1))) - { - for (MFlag mflag : MFlag.getAll()) - { - if (!mflag.isVisible() && ! msender.isUsingAdminMode()) continue; - flags.add(mflag); - } - } - else - { - // Arg: MFlag. Maybe we should use ARSet but that is currently buggy. - List mflags = this.arg(this.argConcatFrom(1), ARList.get(ARMFlag.get())); - flags.addAll(mflags); - } + Faction faction = this.readArg(msenderFaction); + Collection mflags = this.readArg(MFlag.getAll()); // Create messages List messages = new ArrayList(); messages.add(Txt.titleize("Flag for " + faction.describeTo(msender, true))); - for (MFlag mflag : flags) + for (MFlag mflag : mflags) { messages.add(mflag.getStateDesc(faction.getFlag(mflag), true, true, true, true, true)); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java index 4786f115..448d7e1d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java @@ -37,7 +37,7 @@ public class CmdFactionsHome extends FactionsCommandHome this.addAliases("home"); // Args - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.HOME.node)); @@ -58,7 +58,7 @@ public class CmdFactionsHome extends FactionsCommandHome } // Args - Faction faction = this.arg(0, ARFaction.get(), msenderFaction); + Faction faction = this.readArg(msenderFaction); PS home = faction.getHome(); String homeDesc = "home for " + faction.describeTo(msender, false); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java index a835f0b5..55014e9b 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import java.util.Set; +import java.util.Collection; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; @@ -23,8 +23,7 @@ public class CmdFactionsInviteAdd extends FactionsCommand this.addAliases("a", "add"); // Args - this.addRequiredArg("players"); - this.setErrorOnToManyArgs(false); + this.addArg(ARSet.get(ARMPlayer.getAny(), true), "players", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.INVITE_ADD.node)); @@ -38,7 +37,7 @@ public class CmdFactionsInviteAdd extends FactionsCommand public void perform() throws MassiveException { // Args - Set mplayers = this.argConcatFrom(0, ARSet.get(ARMPlayer.getAny(), true)); + Collection mplayers = this.readArg(); // MPerm if ( ! MPerm.getPermInvite().has(msender, msenderFaction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java index 8544045c..aecaf88c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java @@ -27,8 +27,8 @@ public class CmdFactionsInviteList extends FactionsCommand this.addAliases("l", "list"); // Args - this.addOptionalArg("page", "1"); - this.addOptionalArg("faction", "you"); + this.addArg(ARInteger.get(), "page", "1"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.INVITE_LIST.node)); @@ -42,9 +42,9 @@ public class CmdFactionsInviteList extends FactionsCommand public void perform() throws MassiveException { // Args - Integer pageHumanBased = this.arg(0, ARInteger.get(), 1); + int pageHumanBased = this.readArg(1); - Faction faction = this.arg(1, ARFaction.get(), msenderFaction); + Faction faction = this.readArg(msenderFaction); if ( faction != msenderFaction && ! Perm.INVITE_LIST_OTHER.has(sender, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java index c9074d34..7f5c20ab 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java @@ -12,7 +12,6 @@ import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsInvitedChange; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.arg.ARSet; -import com.massivecraft.massivecore.cmd.arg.ARString; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; public class CmdFactionsInviteRemove extends FactionsCommand @@ -26,8 +25,7 @@ public class CmdFactionsInviteRemove extends FactionsCommand this.addAliases("r", "remove"); // Args - this.addRequiredArg("players/all"); - this.setErrorOnToManyArgs(false); + this.addArg(ARSet.get(ARMPlayer.getAny(), true), "players/all", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.INVITE_REMOVE.node)); @@ -44,7 +42,7 @@ public class CmdFactionsInviteRemove extends FactionsCommand boolean all = false; // Args - if (this.arg(0, ARString.get()).equalsIgnoreCase("all")) + if ("all".equalsIgnoreCase(this.argAt(0))) { List invitedPlayers = msenderFaction.getInvitedMPlayers(); // Doesn't show up if list is empty. Test at home if it worked. @@ -58,9 +56,7 @@ public class CmdFactionsInviteRemove extends FactionsCommand } else { - Set senderInput = this.argConcatFrom(0, ARSet.get(ARMPlayer.getAny(), true)); - - mplayers.addAll(senderInput); + mplayers = this.readArgAt(0); } // MPerm diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java index 3690e00c..0d1fedda 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java @@ -26,8 +26,8 @@ public class CmdFactionsJoin extends FactionsCommand this.addAliases("join"); // Args - this.addRequiredArg("faction"); - this.addOptionalArg("player", "you"); + this.addArg(ARFaction.get(), "faction"); + this.addArg(ARMPlayer.getAny(), "player", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.JOIN.node)); @@ -41,9 +41,9 @@ public class CmdFactionsJoin extends FactionsCommand public void perform() throws MassiveException { // Args - Faction faction = this.arg(0, ARFaction.get()); + Faction faction = this.readArg(); - MPlayer mplayer = this.arg(1, ARMPlayer.getAny(), msender); + MPlayer mplayer = this.readArg(msender); Faction mplayerFaction = mplayer.getFaction(); boolean samePlayer = mplayer == msender; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java index 64330e82..96edbeed 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -27,7 +27,7 @@ public class CmdFactionsKick extends FactionsCommand this.addAliases("kick"); // Args - this.addRequiredArg("player"); + this.addArg(ARMPlayer.getAny(), "player"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.KICK.node)); @@ -41,7 +41,7 @@ public class CmdFactionsKick extends FactionsCommand public void perform() throws MassiveException { // Arg - MPlayer mplayer = this.arg(0, ARMPlayer.getAny()); + MPlayer mplayer = this.readArg(); // Validate if (msender == mplayer) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/com/massivecraft/factions/cmd/CmdFactionsList.java index 17d50ea9..e90e7eec 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -30,7 +30,7 @@ public class CmdFactionsList extends FactionsCommand this.addAliases("l", "list"); // Args - this.addOptionalArg("page", "1"); + this.addArg(ARInteger.get(), "page", "1"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.LIST.node)); @@ -44,7 +44,7 @@ public class CmdFactionsList extends FactionsCommand public void perform() throws MassiveException { // Args - final Integer pageHumanBased = this.arg(0, ARInteger.get(), 1); + final int pageHumanBased = this.readArg(1); // NOTE: The faction list is quite slow and mostly thread safe. // We run it asynchronously to spare the primary server thread. diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java index 699b4fd5..780f887f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java @@ -25,7 +25,7 @@ public class CmdFactionsMap extends FactionsCommand this.addAliases("map"); // Args - this.addOptionalArg("on/off", "once"); + this.addArg(ARBoolean.get(), "on/off", "once"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MAP.node)); @@ -39,13 +39,13 @@ public class CmdFactionsMap extends FactionsCommand @Override public void perform() throws MassiveException { - if ( ! this.argIsSet(0)) + if ( ! this.argIsSet()) { showMap(Const.MAP_WIDTH, Const.MAP_HEIGHT_FULL); return; } - if (this.arg(0, ARBoolean.get(), !msender.isMapAutoUpdating())) + if (this.readArg(!msender.isMapAutoUpdating())) { // And show the map once showMap(Const.MAP_WIDTH, Const.MAP_HEIGHT); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java index 44331e33..1f8b6d46 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java @@ -20,7 +20,7 @@ public class CmdFactionsMoneyBalance extends FactionsCommand this.addAliases("b", "balance"); // Args - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_BALANCE.node)); @@ -34,7 +34,7 @@ public class CmdFactionsMoneyBalance extends FactionsCommand @Override public void perform() throws MassiveException { - Faction faction = this.arg(0, ARFaction.get(), msenderFaction); + Faction faction = this.readArg(msenderFaction); if (faction != msenderFaction && ! Perm.MONEY_BALANCE_ANY.has(sender, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java index a1ff6954..aac33641 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java @@ -27,8 +27,8 @@ public class CmdFactionsMoneyDeposit extends FactionsCommand this.addAliases("d", "deposit"); // Args - this.addRequiredArg("amount"); - this.addOptionalArg("faction", "you"); + this.addArg(ARDouble.get(), "amount"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_DEPOSIT.node)); @@ -42,9 +42,9 @@ public class CmdFactionsMoneyDeposit extends FactionsCommand @Override public void perform() throws MassiveException { - Double amount = this.arg(0, ARDouble.get()); + double amount = this.readArg(); - Faction faction = this.arg(1, ARFaction.get(), msenderFaction); + Faction faction = this.readArg(msenderFaction); boolean success = Econ.transferMoney(msender, msender, faction, amount); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java index a2695af7..e9f6a7a3 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java @@ -28,9 +28,9 @@ public class CmdFactionsMoneyTransferFf extends FactionsCommand this.addAliases("ff"); // Args - this.addRequiredArg("amount"); - this.addRequiredArg("faction"); - this.addRequiredArg("faction"); + this.addArg(ARDouble.get(), "amount"); + this.addArg(ARFaction.get(), "faction"); + this.addArg(ARFaction.get(), "faction"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2F.node)); @@ -44,9 +44,9 @@ public class CmdFactionsMoneyTransferFf extends FactionsCommand @Override public void perform() throws MassiveException { - Double amount = this.arg(0, ARDouble.get()); - Faction from = this.arg(1, ARFaction.get()); - Faction to = this.arg(2, ARFaction.get()); + double amount = this.readArg(); + Faction from = this.readArg(); + Faction to = this.readArg(); boolean success = Econ.transferMoney(msender, from, to, amount); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java index 0a3a293a..647f41ee 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java @@ -30,9 +30,9 @@ public class CmdFactionsMoneyTransferFp extends FactionsCommand this.addAliases("fp"); // Args - this.addRequiredArg("amount"); - this.addRequiredArg("faction"); - this.addRequiredArg("player"); + this.addArg(ARDouble.get(), "amount"); + this.addArg(ARFaction.get(), "faction"); + this.addArg(ARMPlayer.getAny(), "player"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2P.node)); @@ -46,9 +46,9 @@ public class CmdFactionsMoneyTransferFp extends FactionsCommand @Override public void perform() throws MassiveException { - Double amount = this.arg(0, ARDouble.get()); - Faction from = this.arg(1, ARFaction.get()); - MPlayer to = this.arg(2, ARMPlayer.getAny()); + double amount = this.readArg(); + Faction from = this.readArg(); + MPlayer to = this.readArg(); boolean success = Econ.transferMoney(msender, from, to, amount); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java index 127bb35d..1f3ac868 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java @@ -30,9 +30,9 @@ public class CmdFactionsMoneyTransferPf extends FactionsCommand this.addAliases("pf"); // Args - this.addRequiredArg("amount"); - this.addRequiredArg("player"); - this.addRequiredArg("faction"); + this.addArg(ARDouble.get(), "amount"); + this.addArg(ARMPlayer.getAny(), "player"); + this.addArg(ARFaction.get(), "faction"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_P2F.node)); @@ -46,9 +46,9 @@ public class CmdFactionsMoneyTransferPf extends FactionsCommand @Override public void perform() throws MassiveException { - Double amount = this.arg(0, ARDouble.get()); - MPlayer from = this.arg(1, ARMPlayer.getAny()); - Faction to = this.arg(2, ARFaction.get()); + double amount = this.readArg(); + MPlayer from = this.readArg(); + Faction to = this.readArg(); boolean success = Econ.transferMoney(msender, from, to, amount); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java index c7dd2c77..f5c7d125 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java @@ -29,8 +29,8 @@ public class CmdFactionsMoneyWithdraw extends FactionsCommand this.addAliases("w", "withdraw"); // Args - this.addRequiredArg("amount"); - this.addOptionalArg("faction", "you"); + this.addArg(ARDouble.get(), "amount"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_WITHDRAW.node)); @@ -44,8 +44,8 @@ public class CmdFactionsMoneyWithdraw extends FactionsCommand @Override public void perform() throws MassiveException { - Double amount = this.arg(0, ARDouble.get()); - Faction from = this.arg(1, ARFaction.get(), msenderFaction); + Double amount = this.readArg(); + Faction from = this.readArg(msenderFaction); MPlayer to = msender; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java b/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java index e3c7c159..2d525813 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java @@ -5,6 +5,8 @@ import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsMotdChange; import com.massivecraft.massivecore.MassiveCore; +import com.massivecraft.massivecore.MassiveException; +import com.massivecraft.massivecore.cmd.arg.ARString; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.util.MUtil; @@ -22,8 +24,7 @@ public class CmdFactionsMotd extends FactionsCommand this.addAliases("motd"); // Args - this.addOptionalArg("new", "read"); - this.setErrorOnToManyArgs(false); + this.addArg(ARString.get(), "new", "read", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MOTD.node)); @@ -34,7 +35,7 @@ public class CmdFactionsMotd extends FactionsCommand // -------------------------------------------- // @Override - public void perform() + public void perform() throws MassiveException { // Read if ( ! this.argIsSet(0)) @@ -47,7 +48,7 @@ public class CmdFactionsMotd extends FactionsCommand if ( ! MPerm.getPermMotd().has(msender, msenderFaction, true)) return; // Args - String target = this.argConcatFrom(0); + String target = this.readArg(); target = target.trim(); target = Txt.parse(target); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsName.java b/src/com/massivecraft/factions/cmd/CmdFactionsName.java index 8b4bbe4b..23f03e11 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsName.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsName.java @@ -10,6 +10,7 @@ import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.event.EventFactionsNameChange; import com.massivecraft.factions.util.MiscUtil; import com.massivecraft.massivecore.MassiveException; +import com.massivecraft.massivecore.cmd.arg.ARString; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; public class CmdFactionsName extends FactionsCommand @@ -24,8 +25,8 @@ public class CmdFactionsName extends FactionsCommand this.addAliases("name"); // Args - this.addRequiredArg("new name"); - this.addOptionalArg("faction", "you"); + this.addArg(ARString.get(), "new name"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.NAME.node)); @@ -39,9 +40,8 @@ public class CmdFactionsName extends FactionsCommand public void perform() throws MassiveException { // Args - String newName = this.arg(0); - - Faction faction = this.arg(1, ARFaction.get(), msenderFaction); + String newName = this.readArg(); + Faction faction = this.readArg(msenderFaction); // MPerm if ( ! MPerm.getPermName().has(msender, faction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java index 05a6daea..9d3239e5 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java @@ -22,7 +22,7 @@ public class CmdFactionsPermList extends FactionsCommand this.addAliases("l", "list"); // Args - this.addOptionalArg("page", "1"); + this.addArg(ARInteger.get(), "page", "1"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PERM_LIST.node)); @@ -36,7 +36,7 @@ public class CmdFactionsPermList extends FactionsCommand public void perform() throws MassiveException { // Args - Integer pageHumanBased = this.arg(0, ARInteger.get(), 1); + int pageHumanBased = this.readArg(1); // Create messages List messages = new ArrayList(); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java index 38c53789..7cb05b9a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java @@ -28,10 +28,10 @@ public class CmdFactionsPermSet extends FactionsCommand this.addAliases("set"); // Args - this.addRequiredArg("perm"); - this.addRequiredArg("relation"); - this.addRequiredArg("yes/no"); - this.addOptionalArg("faction", "you"); + this.addArg(ARMPerm.get(), "perm"); + this.addArg(ARRel.get(), "relation"); + this.addArg(ARBoolean.get(), "yes/no"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PERM_SET.node)); @@ -45,10 +45,10 @@ public class CmdFactionsPermSet extends FactionsCommand public void perform() throws MassiveException { // Args - MPerm perm = this.arg(0, ARMPerm.get()); - Rel rel = this.arg(1, ARRel.get()); - Boolean value = this.arg(2, ARBoolean.get()); - Faction faction = this.arg(3, ARFaction.get(), msenderFaction); + MPerm perm = this.readArg(); + Rel rel = this.readArg(); + Boolean value = this.readArg(); + Faction faction = this.readArg(msenderFaction); // Do the sender have the right to change perms for this faction? if ( ! MPerm.getPermPerms().has(msender, faction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java index cb478287..7b9bb731 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java @@ -9,7 +9,8 @@ import com.massivecraft.factions.cmd.arg.ARMPerm; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARList; +import com.massivecraft.massivecore.cmd.arg.ARAll; +import com.massivecraft.massivecore.cmd.arg.ARSet; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -25,9 +26,8 @@ public class CmdFactionsPermShow extends FactionsCommand this.addAliases("s", "show"); // Args - this.addOptionalArg("faction", "you"); - this.addOptionalArg("perms", "all"); - this.setErrorOnToManyArgs(false); + this.addArg(ARFaction.get(), "faction", "you"); + this.addArg(ARAll.get(ARSet.get(ARMPerm.get(), false)), "perms", "all", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PERM_SHOW.node)); @@ -41,33 +41,15 @@ public class CmdFactionsPermShow extends FactionsCommand public void perform() throws MassiveException { // Arg: Faction - Faction faction = this.arg(0, ARFaction.get(), msenderFaction); - - List perms = new ArrayList(); - - // Case: Show All - if ( ! this.argIsSet(1) || "all".equalsIgnoreCase(this.arg(1))) - { - for (MPerm mperm : MPerm.getAll()) - { - if ( ! mperm.isVisible() && ! msender.isUsingAdminMode()) continue; - perms.add(mperm); - } - } - // Case: Show Some - else - { - // Arg perm. Maybe we should use ARSet but that is currently buggy. - List mperms = this.arg(this.argConcatFrom(1), ARList.get(ARMPerm.get())); - perms.addAll(mperms); - } - + Faction faction = this.readArg(msenderFaction); + List mperms = this.readArg(MPerm.getAll()); + // Create messages List messages = new ArrayList(); messages.add(Txt.titleize("Perm for " + faction.describeTo(msender, true))); messages.add(MPerm.getStateHeaders()); - for (MPerm mperm : perms) + for (MPerm mperm : mperms) { messages.add(Txt.parse(mperm.getStateInfo(faction.getPermitted(mperm), true))); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java index 58d01905..0c3d4051 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java @@ -27,7 +27,7 @@ public class CmdFactionsPlayer extends FactionsCommand this.addAliases("p", "player"); // Args - this.addOptionalArg("player", "you"); + this.addArg(ARMPlayer.getAny(), "player", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node)); @@ -41,7 +41,7 @@ public class CmdFactionsPlayer extends FactionsCommand public void perform() throws MassiveException { // Args - MPlayer mplayer = this.arg(0, ARMPlayer.getAny(), msender); + MPlayer mplayer = this.readArg(msender); // INFO: Title msg(Txt.titleize("Player " + mplayer.describeTo(msender))); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java index ed6f0fdf..e9b390aa 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java @@ -7,11 +7,19 @@ import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.MassiveException; +import com.massivecraft.massivecore.cmd.ArgSetting; import com.massivecraft.massivecore.cmd.arg.ARDouble; +import com.massivecraft.massivecore.cmd.arg.ARString; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; public class CmdFactionsPowerBoost extends FactionsCommand { + // -------------------------------------------- // + // FIELDS + // -------------------------------------------- // + + private ArgSetting setting = ArgSetting.of(ARMPlayer.getAny(), false, "name", null); + // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // @@ -22,9 +30,9 @@ public class CmdFactionsPowerBoost extends FactionsCommand this.addAliases("powerboost"); // Args - this.addRequiredArg("p|f|player|faction"); - this.addRequiredArg("name"); - this.addRequiredArg("#"); + this.addArg(ARString.get(), "p|f|player|faction"); + this.addArg(setting); + this.addArg(ARDouble.get(), "#"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.POWERBOOST.node)); @@ -37,7 +45,7 @@ public class CmdFactionsPowerBoost extends FactionsCommand @Override public void perform() throws MassiveException { - String type = this.arg(0).toLowerCase(); + String type = this.readArg().toLowerCase(); boolean doPlayer = true; if (type.equals("f") || type.equals("faction")) { @@ -50,20 +58,22 @@ public class CmdFactionsPowerBoost extends FactionsCommand return; } - Double targetPower = this.arg(2, ARDouble.get()); + double targetPower = this.readArgAt(2); String target; if (doPlayer) { - MPlayer targetPlayer = this.arg(1, ARMPlayer.getAny()); + setting.setReader(ARMPlayer.getAny()); + MPlayer targetPlayer = this.readArgAt(1); targetPlayer.setPowerBoost(targetPower); target = "Player \""+targetPlayer.getName()+"\""; } else { - Faction targetFaction = this.arg(1, ARFaction.get()); + setting.setReader(ARFaction.get()); + Faction targetFaction = this.readArgAt(1); targetFaction.setPowerBoost(targetPower); target = "Faction \""+targetFaction.getName()+"\""; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRank.java b/src/com/massivecraft/factions/cmd/CmdFactionsRank.java index 99913d0a..3d6d3249 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRank.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRank.java @@ -48,6 +48,9 @@ public class CmdFactionsRank extends FactionsCommand private Rel targetRank = null; private Rel rank = null; + // This one is permanent + private ARRank rankReader = new ARRank(); + // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // @@ -58,9 +61,9 @@ public class CmdFactionsRank extends FactionsCommand this.addAliases("rank"); // Args - this.addRequiredArg("player"); - this.addOptionalArg("action", "show"); - this.addOptionalArg("faction", "their"); + this.addArg(ARMPlayer.getAny(), "player"); + this.addArg(rankReader, "action", "show"); + this.addArg(ARFaction.get(), "faction", "their"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.RANK.node)); @@ -123,22 +126,25 @@ public class CmdFactionsRank extends FactionsCommand private void registerFields() throws MassiveException { // Getting the target and faction. - target = this.arg(0, ARMPlayer.getAny(), msender); + target = this.readArg(msender); targetFaction = target.getFaction(); - // Rank if any passed. - if (this.argIsSet(1)) - { - rank = this.arg(1, ARRank.get(target.getRole())); - } - - // Changing peoples faction. - endFaction = this.arg(2, ARFaction.get(), targetFaction); - factionChange = (endFaction != targetFaction); // Ranks senderRank = msender.getRole(); targetRank = target.getRole(); + + // Rank if any passed. + if (this.argIsSet(1)) + { + this.rankReader.setStartRank(targetRank); + rank = this.readArg(); + } + + // Changing peoples faction. + endFaction = this.readArgAt(2, targetFaction); + factionChange = (endFaction != targetFaction); + } private void unregisterFields() diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java index 7c8f4b63..6951ee27 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java @@ -1,6 +1,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; +import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.massivecore.cmd.VisibilityMode; import com.massivecraft.massivecore.util.MUtil; @@ -25,8 +27,8 @@ public class CmdFactionsRankOld extends FactionsCommand this.addAliases(rankName); // Args - this.addRequiredArg("player"); - this.addOptionalArg("faction", "their"); + this.addArg(ARMPlayer.getAny(), "player"); + this.addArg(ARFaction.get(), "faction", "their"); // VisibilityMode this.setVisibilityMode(VisibilityMode.INVISIBLE); @@ -39,7 +41,7 @@ public class CmdFactionsRankOld extends FactionsCommand @Override public void perform() { - Factions.get().getOuterCmdFactions().cmdFactionsRank.execute(sender, MUtil.list(this.arg(0), this.rankName, this.arg(1))); + Factions.get().getOuterCmdFactions().cmdFactionsRank.execute(sender, MUtil.list(this.argAt(0), this.rankName, this.argAt(1))); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java index f5c3fb33..63196431 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java @@ -23,7 +23,7 @@ public abstract class CmdFactionsRelationAbstract extends FactionsCommand public CmdFactionsRelationAbstract() { // Aliases - this.addRequiredArg("faction"); + this.addArg(ARFaction.get(), "faction"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.RELATION.node)); @@ -38,7 +38,7 @@ public abstract class CmdFactionsRelationAbstract extends FactionsCommand public void perform() throws MassiveException { // Args - Faction otherFaction = this.arg(0, ARFaction.get()); + Faction otherFaction = this.readArg(); Rel newRelation = targetRelation; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java b/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java index c15d4ad0..62a84f5c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java @@ -19,7 +19,7 @@ public class CmdFactionsSeeChunk extends FactionsCommand this.addAliases("sc", "seechunk"); // Args - this.addOptionalArg("active", "toggle"); + this.addArg(ARBoolean.get(), "active", "toggle"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.SEECHUNK.node)); @@ -36,11 +36,11 @@ public class CmdFactionsSeeChunk extends FactionsCommand // Args boolean old = msender.isSeeingChunk(); boolean targetDefault = !old; - Boolean target = this.arg(0, ARBoolean.get(), targetDefault); + boolean target = this.readArg(targetDefault); String targetDesc = Txt.parse(target ? "ON": "OFF"); // NoChange - if (target.equals(old)) + if (target == old) { msg("See Chunk is already %s.", targetDesc); return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetAll.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetAll.java index c0a16c1c..8d09a35d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetAll.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetAll.java @@ -1,5 +1,7 @@ package com.massivecraft.factions.cmd; +import java.util.Collections; +import java.util.List; import java.util.Set; import com.massivecraft.factions.Perm; @@ -7,9 +9,7 @@ import com.massivecraft.factions.entity.Board; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARWorldId; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.util.MUtil; @@ -17,6 +17,13 @@ import com.massivecraft.massivecore.util.MUtil; public class CmdFactionsSetAll extends CmdFactionsSetXAll { + // -------------------------------------------- // + // CONSTANTS + // -------------------------------------------- // + + public static final List LIST_ALL = Collections.unmodifiableList(MUtil.list("a", "al", "all")); + public static final List LIST_MAP = Collections.singletonList("map"); + // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // @@ -30,7 +37,6 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll this.addAliases("all"); // Requirements - this.addRequirements(ReqIsPlayer.get()); String node = claim ? Perm.CLAIM_ALL.node : Perm.UNCLAIM_ALL.node; this.addRequirements(ReqHasPerm.get(node)); } @@ -52,7 +58,7 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll Faction oldFaction = this.getOldFaction(); if (oldFaction == null) return null; - if (MUtil.list("a", "al", "all").contains(this.arg(0).toLowerCase())) + if (LIST_ALL.contains(this.argAt(0).toLowerCase())) { chunks = BoardColl.get().getChunks(oldFaction); this.setFormatOne("%s %s %d chunk using " + word + " all."); @@ -61,7 +67,7 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll else { String worldId = null; - if (MUtil.list("map").contains(this.arg(0).toLowerCase())) + if (LIST_MAP.contains(this.argAt(0).toLowerCase())) { if (me != null) { @@ -75,7 +81,7 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll } else { - worldId = this.arg(0, ARWorldId.get()); + worldId = this.argAt(0); if (worldId == null) return null; } Board board = BoardColl.get().get(worldId); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java index 7e01f6a4..f0506815 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java @@ -39,7 +39,7 @@ public class CmdFactionsSetAuto extends FactionsCommand // Args if (claim) { - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); } // Requirements @@ -59,7 +59,7 @@ public class CmdFactionsSetAuto extends FactionsCommand final Faction newFaction; if (claim) { - newFaction = this.arg(0, ARFaction.get(), msenderFaction); + newFaction = this.readArg(msenderFaction); } else { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetX.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetX.java index 053f9f7a..28d3b0f4 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetX.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetX.java @@ -2,13 +2,11 @@ package com.massivecraft.factions.cmd; import java.util.Set; -import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.ps.PS; - public abstract class CmdFactionsSetX extends FactionsCommand { // -------------------------------------------- // @@ -69,7 +67,7 @@ public abstract class CmdFactionsSetX extends FactionsCommand { if (this.isClaim()) { - return this.arg(this.getFactionArgIndex(), ARFaction.get(), msenderFaction); + return this.readArgAt(this.getFactionArgIndex(), msenderFaction); } else { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java index ccda3f91..a7255ed7 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java @@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.MassiveException; +import com.massivecraft.massivecore.cmd.arg.ARString; public abstract class CmdFactionsSetXAll extends CmdFactionsSetX { @@ -16,11 +17,11 @@ public abstract class CmdFactionsSetXAll extends CmdFactionsSetX super(claim); // Args - this.addRequiredArg("all|map"); - this.addRequiredArg("faction"); + this.addArg(ARString.get(), "all|map"); + this.addArg(ARFaction.get(), "faction"); if (claim) { - this.addRequiredArg("newfaction"); + this.addArg(ARFaction.get(), "newfaction"); this.setFactionArgIndex(2); } } @@ -31,7 +32,7 @@ public abstract class CmdFactionsSetXAll extends CmdFactionsSetX public Faction getOldFaction() throws MassiveException { - return this.arg(1, ARFaction.get()); + return this.readArgAt(1); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java index 164df1f7..73372020 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java @@ -1,5 +1,6 @@ package com.massivecraft.factions.cmd; +import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.arg.ARInteger; @@ -17,10 +18,10 @@ public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX super(claim); // Args - this.addOptionalArg("radius", "1"); + this.addArg(ARInteger.get(), "radius", "1"); if (claim) { - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); this.setFactionArgIndex(1); } } @@ -31,8 +32,7 @@ public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX public Integer getRadius() throws MassiveException { - Integer radius = this.arg(0, ARInteger.get(), 1); - if (radius == null) return radius; + int radius = this.readArg(1); // Radius Claim Min if (radius < 1) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetXSimple.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetXSimple.java index 6c0c7544..977feaa7 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetXSimple.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetXSimple.java @@ -1,5 +1,7 @@ package com.massivecraft.factions.cmd; +import com.massivecraft.factions.cmd.arg.ARFaction; + public abstract class CmdFactionsSetXSimple extends CmdFactionsSetX { // -------------------------------------------- // @@ -14,7 +16,7 @@ public abstract class CmdFactionsSetXSimple extends CmdFactionsSetX // Args if (claim) { - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); this.setFactionArgIndex(0); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java index 5cd280c7..71fc0412 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java @@ -23,7 +23,7 @@ public class CmdFactionsSethome extends FactionsCommandHome this.addAliases("sethome"); // Args - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.SETHOME.node)); @@ -38,7 +38,7 @@ public class CmdFactionsSethome extends FactionsCommandHome public void perform() throws MassiveException { // Args - Faction faction = this.arg(0, ARFaction.get(), msenderFaction); + Faction faction = this.readArg(msenderFaction); PS newHome = PS.valueOf(me.getLocation()); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java index 1f1fa44f..97df857c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java @@ -21,8 +21,8 @@ public class CmdFactionsSetpower extends FactionsCommand this.addAliases("sp", "setpower"); // Args - this.addRequiredArg("player"); - this.addRequiredArg("power"); + this.addArg(ARMPlayer.getAny(), "player"); + this.addArg(ARDouble.get(), "power"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.SETPOWER.node)); @@ -36,8 +36,8 @@ public class CmdFactionsSetpower extends FactionsCommand public void perform() throws MassiveException { // Args - MPlayer mplayer = this.arg(0, ARMPlayer.getAny()); - Double power = this.arg(1, ARDouble.get()); + MPlayer mplayer = this.readArg(); + double power = this.readArg(); // Power double oldPower = mplayer.getPower(); @@ -48,7 +48,7 @@ public class CmdFactionsSetpower extends FactionsCommand double maxDifference = 0.1d; if (difference < maxDifference) { - msender.msg("%s's power is already %.2f.", mplayer.getDisplayName(msender), newPower); + msg("%s's power is already %.2f.", mplayer.getDisplayName(msender), newPower); return; } @@ -58,7 +58,7 @@ public class CmdFactionsSetpower extends FactionsCommand if (event.isCancelled()) return; // Inform - msender.msg("You changed %s's power from %.2f to %.2f.", mplayer.getDisplayName(msender), oldPower, newPower); + msg("You changed %s's power from %.2f to %.2f.", mplayer.getDisplayName(msender), oldPower, newPower); if (msender != mplayer) { mplayer.msg("%s changed your power from %.2f to %.2f.", msender.getDisplayName(mplayer), oldPower, newPower); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java b/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java index 035b52c2..6a81365a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java @@ -34,9 +34,9 @@ public class CmdFactionsStatus extends FactionsCommand this.addAliases("s", "status"); // Args - this.addOptionalArg("page", "1"); - this.addOptionalArg("faction", "you"); - this.addOptionalArg("sort by", "time"); + this.addArg(ARInteger.get(), "page", "1"); + this.addArg(ARFaction.get(), "faction", "you"); + this.addArg(ARSortMPlayer.get(), "sort by", "time"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.STATUS.node)); @@ -50,9 +50,9 @@ public class CmdFactionsStatus extends FactionsCommand public void perform() throws MassiveException { // Args - Integer pageHumanBased = this.arg(0, ARInteger.get(), 1); - Faction faction = this.arg(1, ARFaction.get(), msenderFaction); - Comparator sortedBy = this.arg(2, ARSortMPlayer.get(), PlayerInactivityComparator.get()); + Integer pageHumanBased = this.readArg(1); + Faction faction = this.readArg(msenderFaction); + Comparator sortedBy = this.readArg(PlayerInactivityComparator.get()); // MPerm if ( ! MPerm.getPermStatus().has(msender, faction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java index 90ebe1c8..33f6ac44 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java @@ -24,8 +24,8 @@ public class CmdFactionsTitle extends FactionsCommand this.addAliases("title"); // Args - this.addRequiredArg("player"); - this.addOptionalArg("title", ""); + this.addArg(ARMPlayer.getAny(), "player"); + this.addArg(ARString.get(), "title", "", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.TITLE.node)); @@ -39,8 +39,8 @@ public class CmdFactionsTitle extends FactionsCommand public void perform() throws MassiveException { // Args - MPlayer you = this.arg(0, ARMPlayer.getAny()); - String newTitle = this.argConcatFrom(1, ARString.get(), ""); + MPlayer you = this.readArg(); + String newTitle = this.readArg(""); newTitle = Txt.parse(newTitle); if (!Perm.TITLE_COLOR.has(sender, false)) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java index 51e36a51..2cc3feac 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java @@ -20,7 +20,7 @@ public class CmdFactionsUnsethome extends FactionsCommandHome this.addAliases("unsethome"); // Args - this.addOptionalArg("faction", "you"); + this.addArg(ARFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.UNSETHOME.node)); @@ -34,7 +34,7 @@ public class CmdFactionsUnsethome extends FactionsCommandHome public void perform() throws MassiveException { // Args - Faction faction = this.arg(0, ARFaction.get(), msenderFaction); + Faction faction = this.readArg(msenderFaction); // Any and MPerm if ( ! MPerm.getPermSethome().has(msender, faction, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java b/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java index b680c171..f1f1db39 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java @@ -24,7 +24,7 @@ public class CmdFactionsXPlaceholder extends FactionsCommand this.setDesc("Use " + extensionName); // Args - this.setErrorOnToManyArgs(false); + this.setGivingErrorOnTooManyArgs(false); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/arg/ARFaction.java b/src/com/massivecraft/factions/cmd/arg/ARFaction.java index 27b142f4..6b87e476 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARFaction.java +++ b/src/com/massivecraft/factions/cmd/arg/ARFaction.java @@ -1,17 +1,19 @@ package com.massivecraft.factions.cmd.arg; import java.util.Collection; -import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.MPlayer; +import com.massivecraft.massivecore.CaseInsensitiveComparator; import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.cmd.arg.ARAbstract; -import com.massivecraft.massivecore.collections.MassiveList; import com.massivecraft.massivecore.util.IdUtil; public class ARFaction extends ARAbstract @@ -63,11 +65,11 @@ public class ARFaction extends ARAbstract @Override public Collection getTabList(CommandSender sender, String arg) { - List ret = new MassiveList(); + Set ret = new TreeSet(CaseInsensitiveComparator.get()); for (Faction faction : FactionColl.get().getAll()) { - ret.add(faction.getName()); + ret.add(ChatColor.stripColor(faction.getName())); } return ret; diff --git a/src/com/massivecraft/factions/cmd/arg/ARMFlag.java b/src/com/massivecraft/factions/cmd/arg/ARMFlag.java index 0cc47b47..05a34bbb 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARMFlag.java +++ b/src/com/massivecraft/factions/cmd/arg/ARMFlag.java @@ -8,9 +8,10 @@ import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.massivecore.cmd.arg.ARAbstractSelect; +import com.massivecraft.massivecore.cmd.arg.ARAllAble; import com.massivecraft.massivecore.util.Txt; -public class ARMFlag extends ARAbstractSelect +public class ARMFlag extends ARAbstractSelect implements ARAllAble { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -76,6 +77,12 @@ public class ARMFlag extends ARAbstractSelect { return this.altNames(sender); } + + @Override + public Collection getAll(CommandSender sender) + { + return MFlag.getAll(); + } // -------------------------------------------- // // UTIL diff --git a/src/com/massivecraft/factions/cmd/arg/ARMPerm.java b/src/com/massivecraft/factions/cmd/arg/ARMPerm.java index 0c13f508..48a1351d 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARMPerm.java +++ b/src/com/massivecraft/factions/cmd/arg/ARMPerm.java @@ -8,9 +8,10 @@ import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.massivecore.cmd.arg.ARAbstractSelect; +import com.massivecraft.massivecore.cmd.arg.ARAllAble; import com.massivecraft.massivecore.util.Txt; -public class ARMPerm extends ARAbstractSelect +public class ARMPerm extends ARAbstractSelect implements ARAllAble { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -76,6 +77,12 @@ public class ARMPerm extends ARAbstractSelect { return this.altNames(sender); } + + @Override + public Collection getAll(CommandSender sender) + { + return MPerm.getAll(); + } // -------------------------------------------- // // UTIL diff --git a/src/com/massivecraft/factions/cmd/arg/ARRank.java b/src/com/massivecraft/factions/cmd/arg/ARRank.java index 80e0c6a2..b6493b72 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARRank.java +++ b/src/com/massivecraft/factions/cmd/arg/ARRank.java @@ -54,8 +54,9 @@ public class ARRank extends ARAbstractSelect // FIELDS // -------------------------------------------- // - private final Rel startRank; + private Rel startRank; public Rel getStartRank() { return this.startRank; } + public void setStartRank(Rel startRank) { this.startRank = startRank; } // -------------------------------------------- // // OVERRIDE