From 753310561aded16e8b1be7a9d0cd775e17743d1f Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 21 Oct 2015 19:35:41 +0200 Subject: [PATCH] MassiveCore - Heavy Refactoring and Command improvements --- ...ctate.java => FactionEqualsPredicate.java} | 6 +- .../factions/cmd/CmdFactions.java | 98 +++++++++---------- .../factions/cmd/CmdFactionsAccess.java | 8 +- .../cmd/CmdFactionsAccessFaction.java | 10 +- .../factions/cmd/CmdFactionsAccessPlayer.java | 10 +- .../factions/cmd/CmdFactionsAdmin.java | 6 +- .../factions/cmd/CmdFactionsClaim.java | 14 +-- .../factions/cmd/CmdFactionsCreate.java | 8 +- .../factions/cmd/CmdFactionsDescription.java | 6 +- .../factions/cmd/CmdFactionsDisband.java | 6 +- .../factions/cmd/CmdFactionsFaction.java | 6 +- .../factions/cmd/CmdFactionsFlag.java | 8 +- .../factions/cmd/CmdFactionsFlagList.java | 6 +- .../factions/cmd/CmdFactionsFlagSet.java | 14 +-- .../factions/cmd/CmdFactionsFlagShow.java | 14 +-- .../factions/cmd/CmdFactionsHome.java | 8 +- .../factions/cmd/CmdFactionsInvite.java | 8 +- .../factions/cmd/CmdFactionsInviteAdd.java | 8 +- .../factions/cmd/CmdFactionsInviteList.java | 10 +- .../factions/cmd/CmdFactionsInviteRemove.java | 8 +- .../factions/cmd/CmdFactionsJoin.java | 10 +- .../factions/cmd/CmdFactionsKick.java | 8 +- .../factions/cmd/CmdFactionsList.java | 6 +- .../factions/cmd/CmdFactionsMap.java | 6 +- .../factions/cmd/CmdFactionsMoney.java | 14 +-- .../factions/cmd/CmdFactionsMoneyBalance.java | 6 +- .../factions/cmd/CmdFactionsMoneyDeposit.java | 10 +- .../cmd/CmdFactionsMoneyTransferFf.java | 12 +-- .../cmd/CmdFactionsMoneyTransferFp.java | 14 +-- .../cmd/CmdFactionsMoneyTransferPf.java | 14 +-- .../cmd/CmdFactionsMoneyWithdraw.java | 10 +- .../factions/cmd/CmdFactionsMotd.java | 6 +- .../factions/cmd/CmdFactionsName.java | 10 +- .../factions/cmd/CmdFactionsPerm.java | 8 +- .../factions/cmd/CmdFactionsPermList.java | 6 +- .../factions/cmd/CmdFactionsPermSet.java | 18 ++-- .../factions/cmd/CmdFactionsPermShow.java | 14 +-- .../factions/cmd/CmdFactionsPlayer.java | 6 +- .../factions/cmd/CmdFactionsPowerBoost.java | 26 ++--- .../factions/cmd/CmdFactionsRank.java | 26 ++--- .../factions/cmd/CmdFactionsRankOld.java | 16 +-- .../cmd/CmdFactionsRelationAbstract.java | 4 +- .../factions/cmd/CmdFactionsSeeChunk.java | 6 +- .../factions/cmd/CmdFactionsSetAuto.java | 6 +- .../factions/cmd/CmdFactionsSetXAll.java | 12 +-- .../factions/cmd/CmdFactionsSetXRadius.java | 10 +- .../factions/cmd/CmdFactionsSetXSimple.java | 6 +- .../factions/cmd/CmdFactionsSethome.java | 8 +- .../factions/cmd/CmdFactionsSetpower.java | 10 +- .../factions/cmd/CmdFactionsStatus.java | 14 +-- .../cmd/CmdFactionsTerritorytitles.java | 14 +-- .../factions/cmd/CmdFactionsTitle.java | 10 +- .../factions/cmd/CmdFactionsUnclaim.java | 14 +-- .../factions/cmd/CmdFactionsUnsethome.java | 6 +- .../factions/cmd/CmdFactionsXPlaceholder.java | 4 +- .../factions/cmd/FactionsCommand.java | 14 +-- .../factions/cmd/FactionsCommandHome.java | 6 +- .../ARFaction.java => type/TypeFaction.java} | 10 +- .../{arg/ARMFlag.java => type/TypeMFlag.java} | 12 +-- .../{arg/ARMPerm.java => type/TypeMPerm.java} | 12 +-- .../ARMPlayer.java => type/TypeMPlayer.java} | 10 +- .../{arg/ARRank.java => type/TypeRank.java} | 16 +-- .../cmd/{arg/ARRel.java => type/TypeRel.java} | 10 +- .../TypeSortMPlayer.java} | 10 +- .../massivecraft/factions/entity/Faction.java | 14 +-- .../massivecraft/factions/entity/MFlag.java | 4 +- .../massivecraft/factions/entity/MPerm.java | 6 +- 67 files changed, 376 insertions(+), 380 deletions(-) rename src/com/massivecraft/factions/{FactionEqualsPredictate.java => FactionEqualsPredicate.java} (81%) rename src/com/massivecraft/factions/cmd/{arg/ARFaction.java => type/TypeFaction.java} (84%) rename src/com/massivecraft/factions/cmd/{arg/ARMFlag.java => type/TypeMFlag.java} (80%) rename src/com/massivecraft/factions/cmd/{arg/ARMPerm.java => type/TypeMPerm.java} (80%) rename src/com/massivecraft/factions/cmd/{arg/ARMPlayer.java => type/TypeMPlayer.java} (51%) rename src/com/massivecraft/factions/cmd/{arg/ARRank.java => type/TypeRank.java} (91%) rename src/com/massivecraft/factions/cmd/{arg/ARRel.java => type/TypeRel.java} (75%) rename src/com/massivecraft/factions/cmd/{arg/ARSortMPlayer.java => type/TypeSortMPlayer.java} (81%) diff --git a/src/com/massivecraft/factions/FactionEqualsPredictate.java b/src/com/massivecraft/factions/FactionEqualsPredicate.java similarity index 81% rename from src/com/massivecraft/factions/FactionEqualsPredictate.java rename to src/com/massivecraft/factions/FactionEqualsPredicate.java index 1c667581..8e79f158 100644 --- a/src/com/massivecraft/factions/FactionEqualsPredictate.java +++ b/src/com/massivecraft/factions/FactionEqualsPredicate.java @@ -6,10 +6,10 @@ import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; -import com.massivecraft.massivecore.Predictate; +import com.massivecraft.massivecore.Predicate; import com.massivecraft.massivecore.util.MUtil; -public class FactionEqualsPredictate implements Predictate, Serializable +public class FactionEqualsPredicate implements Predicate, Serializable { private static final long serialVersionUID = 1L; @@ -24,7 +24,7 @@ public class FactionEqualsPredictate implements Predictate, Seria // CONSTRUCT // -------------------------------------------- // - public FactionEqualsPredictate(Faction faction) + public FactionEqualsPredicate(Faction faction) { this.factionId = faction.getId(); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactions.java b/src/com/massivecraft/factions/cmd/CmdFactions.java index 1fe372ed..6aea0554 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactions.java +++ b/src/com/massivecraft/factions/cmd/CmdFactions.java @@ -65,57 +65,57 @@ public class CmdFactions extends FactionsCommand public CmdFactions() { - // SubCommands - this.addSubCommand(this.cmdFactionsList); - this.addSubCommand(this.cmdFactionsFaction); - this.addSubCommand(this.cmdFactionsPlayer); - this.addSubCommand(this.cmdFactionsStatus); - this.addSubCommand(this.cmdFactionsJoin); - this.addSubCommand(this.cmdFactionsLeave); - this.addSubCommand(this.cmdFactionsHome); - this.addSubCommand(this.cmdFactionsMap); - this.addSubCommand(this.cmdFactionsCreate); - this.addSubCommand(this.cmdFactionsName); - this.addSubCommand(this.cmdFactionsDescription); - this.addSubCommand(this.cmdFactionsMotd); - this.addSubCommand(this.cmdFactionsSethome); - this.addSubCommand(this.cmdFactionsUnsethome); - this.addSubCommand(this.cmdFactionsInvite); - this.addSubCommand(this.cmdFactionsKick); - this.addSubCommand(this.cmdFactionsTitle); - this.addSubCommand(this.cmdFactionsRank); - this.addSubCommand(this.cmdFactionsRankOldLeader); - this.addSubCommand(this.cmdFactionsRankOldOfficer); - this.addSubCommand(this.cmdFactionsRankOldPromote); - this.addSubCommand(this.cmdFactionsRankOldDemote); - this.addSubCommand(this.cmdFactionsMoney); - this.addSubCommand(this.cmdFactionsSeeChunk); - this.addSubCommand(this.cmdFactionsSeeChunkOld); - this.addSubCommand(this.cmdFactionsTerritorytitles); - this.addSubCommand(this.cmdFactionsClaim); - this.addSubCommand(this.cmdFactionsUnclaim); - this.addSubCommand(this.cmdFactionsAccess); - this.addSubCommand(this.cmdFactionsRelationAlly); - this.addSubCommand(this.cmdFactionsRelationTruce); - this.addSubCommand(this.cmdFactionsRelationNeutral); - this.addSubCommand(this.cmdFactionsRelationEnemy); - this.addSubCommand(this.cmdFactionsPerm); - this.addSubCommand(this.cmdFactionsFlag); - this.addSubCommand(this.cmdFactionsUnstuck); - this.addSubCommand(this.cmdFactionsExpansions); - this.addSubCommand(this.cmdFactionsTax); - this.addSubCommand(this.cmdFactionsDynmap); - this.addSubCommand(this.cmdFactionsAdmin); - this.addSubCommand(this.cmdFactionsDisband); - this.addSubCommand(this.cmdFactionsPowerBoost); - this.addSubCommand(this.cmdFactionsSetpower); - this.addSubCommand(this.cmdFactionsVersion); + // Children + this.addChild(this.cmdFactionsList); + this.addChild(this.cmdFactionsFaction); + this.addChild(this.cmdFactionsPlayer); + this.addChild(this.cmdFactionsStatus); + this.addChild(this.cmdFactionsJoin); + this.addChild(this.cmdFactionsLeave); + this.addChild(this.cmdFactionsHome); + this.addChild(this.cmdFactionsMap); + this.addChild(this.cmdFactionsCreate); + this.addChild(this.cmdFactionsName); + this.addChild(this.cmdFactionsDescription); + this.addChild(this.cmdFactionsMotd); + this.addChild(this.cmdFactionsSethome); + this.addChild(this.cmdFactionsUnsethome); + this.addChild(this.cmdFactionsInvite); + this.addChild(this.cmdFactionsKick); + this.addChild(this.cmdFactionsTitle); + this.addChild(this.cmdFactionsRank); + this.addChild(this.cmdFactionsRankOldLeader); + this.addChild(this.cmdFactionsRankOldOfficer); + this.addChild(this.cmdFactionsRankOldPromote); + this.addChild(this.cmdFactionsRankOldDemote); + this.addChild(this.cmdFactionsMoney); + this.addChild(this.cmdFactionsSeeChunk); + this.addChild(this.cmdFactionsSeeChunkOld); + this.addChild(this.cmdFactionsTerritorytitles); + this.addChild(this.cmdFactionsClaim); + this.addChild(this.cmdFactionsUnclaim); + this.addChild(this.cmdFactionsAccess); + this.addChild(this.cmdFactionsRelationAlly); + this.addChild(this.cmdFactionsRelationTruce); + this.addChild(this.cmdFactionsRelationNeutral); + this.addChild(this.cmdFactionsRelationEnemy); + this.addChild(this.cmdFactionsPerm); + this.addChild(this.cmdFactionsFlag); + this.addChild(this.cmdFactionsUnstuck); + this.addChild(this.cmdFactionsExpansions); + this.addChild(this.cmdFactionsTax); + this.addChild(this.cmdFactionsDynmap); + this.addChild(this.cmdFactionsAdmin); + this.addChild(this.cmdFactionsDisband); + this.addChild(this.cmdFactionsPowerBoost); + this.addChild(this.cmdFactionsSetpower); + this.addChild(this.cmdFactionsVersion); // Deprecated Commands - this.addSubCommand(new DeprecatedCommand(this.cmdFactionsClaim.cmdFactionsClaimAuto, "autoclaim")); - this.addSubCommand(new DeprecatedCommand(this.cmdFactionsUnclaim.cmdFactionsUnclaimAll, "unclaimall")); - this.addSubCommand(new DeprecatedCommand(this.cmdFactionsFlag, "open")); - this.addSubCommand(new DeprecatedCommand(this.cmdFactionsFaction, "show", "who")); + this.addChild(new DeprecatedCommand(this.cmdFactionsClaim.cmdFactionsClaimAuto, "autoclaim")); + this.addChild(new DeprecatedCommand(this.cmdFactionsUnclaim.cmdFactionsUnclaimAll, "unclaimall")); + this.addChild(new DeprecatedCommand(this.cmdFactionsFlag, "open")); + this.addChild(new DeprecatedCommand(this.cmdFactionsFaction, "show", "who")); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java index c8191f31..0d504023 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java @@ -21,10 +21,10 @@ public class CmdFactionsAccess extends FactionsCommand public CmdFactionsAccess() { - // Add SubCommands - this.addSubCommand(this.cmdFactionsAccessView); - this.addSubCommand(this.cmdFactionsAccessPlayer); - this.addSubCommand(this.cmdFactionsAccessFaction); + // Children + this.addChild(this.cmdFactionsAccessView); + this.addChild(this.cmdFactionsAccessPlayer); + this.addChild(this.cmdFactionsAccessFaction); // Aliases this.addAliases("access"); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java index 1d181cd2..109ef3b8 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java @@ -1,13 +1,13 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARBoolean; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeBoolean; public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract { @@ -20,9 +20,9 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract // Aliases this.addAliases("f", "faction"); - // Args - this.addArg(ARFaction.get(), "faction"); - this.addArg(ARBoolean.get(), "yes/no", "toggle"); + // Parameters + this.addParameter(TypeFaction.get(), "faction"); + this.addParameter(TypeBoolean.get(), "yes/no", "toggle"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.ACCESS_FACTION.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java index b6d97799..8126bd22 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java @@ -1,13 +1,13 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARBoolean; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeBoolean; public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract { @@ -20,9 +20,9 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract // Aliases this.addAliases("p", "player"); - // Args - this.addArg(ARMPlayer.get(), "player"); - this.addArg(ARBoolean.get(), "yes/no", "toggle"); + // Parameters + this.addParameter(TypeMPlayer.get(), "player"); + this.addParameter(TypeBoolean.get(), "yes/no", "toggle"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.ACCESS_PLAYER.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java b/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java index 6fa0b44f..084268fc 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java @@ -3,8 +3,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARBoolean; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.Txt; @@ -19,8 +19,8 @@ public class CmdFactionsAdmin extends FactionsCommand // Aliases this.addAliases("admin"); - // Args - this.addArg(ARBoolean.get(), "on/off", "flip"); + // Parameters + this.addParameter(TypeBoolean.get(), "on/off", "flip"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.ADMIN.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java index 1154dad6..0236fdf1 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java @@ -26,13 +26,13 @@ public class CmdFactionsClaim extends FactionsCommand // Aliases this.addAliases("claim"); - // Add SubCommands - this.addSubCommand(this.cmdFactionsClaimOne); - this.addSubCommand(this.cmdFactionsClaimAuto); - this.addSubCommand(this.cmdFactionsClaimFill); - this.addSubCommand(this.cmdFactionsClaimSquare); - this.addSubCommand(this.cmdFactionsClaimCircle); - this.addSubCommand(this.cmdFactionsClaimAll); + // Children + this.addChild(this.cmdFactionsClaimOne); + this.addChild(this.cmdFactionsClaimAuto); + this.addChild(this.cmdFactionsClaimFill); + this.addChild(this.cmdFactionsClaimSquare); + this.addChild(this.cmdFactionsClaimCircle); + this.addChild(this.cmdFactionsClaimAll); // Requirements this.addRequirements(ReqHasPerm.get(Perm.CLAIM.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java index a4f9a45d..471acd44 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java @@ -15,8 +15,8 @@ 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.cmd.type.TypeString; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.store.MStore; @@ -31,8 +31,8 @@ public class CmdFactionsCreate extends FactionsCommand // Aliases this.addAliases("create"); - // Args - this.addArg(ARString.get(), "name"); + // Parameters + this.addParameter(TypeString.get(), "name"); // Requirements this.addRequirements(ReqHasntFaction.get()); @@ -84,7 +84,7 @@ public class CmdFactionsCreate extends FactionsCommand // Inform msg("You created the faction %s", faction.getName(msender)); - message(Mson.mson(mson("You should now: ").color(ChatColor.YELLOW), Factions.get().getOuterCmdFactions().cmdFactionsDescription.getUseageTemplate())); + message(Mson.mson(mson("You should now: ").color(ChatColor.YELLOW), Factions.get().getOuterCmdFactions().cmdFactionsDescription.getTemplate())); // Log if (MConf.get().logFactionCreate) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java index a7188454..a1182afd 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java @@ -6,8 +6,8 @@ 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.cmd.type.TypeString; import com.massivecraft.massivecore.mixin.Mixin; public class CmdFactionsDescription extends FactionsCommand @@ -21,8 +21,8 @@ public class CmdFactionsDescription extends FactionsCommand // Aliases this.addAliases("desc"); - // Args - this.addArg(ARString.get(), "desc", true); + // Parameters + this.addParameter(TypeString.get(), "desc", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java index e6e2d635..15234bac 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MPerm; @@ -28,8 +28,8 @@ public class CmdFactionsDisband extends FactionsCommand // Aliases this.addAliases("disband"); - // Args - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.DISBAND.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java b/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java index ce1b54c2..3dba9db7 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java @@ -5,7 +5,7 @@ import java.util.TreeSet; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.event.EventFactionsFactionShowAsync; import com.massivecraft.factions.Factions; @@ -27,8 +27,8 @@ public class CmdFactionsFaction extends FactionsCommand // Aliases this.addAliases("f", "faction"); - // Args - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FACTION.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java index b4bb6130..6dcc4249 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java @@ -22,10 +22,10 @@ public class CmdFactionsFlag extends FactionsCommand // Aliases this.addAliases("flag"); - // Subcommands - this.addSubCommand(this.cmdFactionsFlagList); - this.addSubCommand(this.cmdFactionsFlagShow); - this.addSubCommand(this.cmdFactionsFlagSet); + // Children + this.addChild(this.cmdFactionsFlagList); + this.addChild(this.cmdFactionsFlagShow); + this.addChild(this.cmdFactionsFlagSet); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FLAG.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java index b5e1d278..a947d2a6 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java @@ -6,7 +6,7 @@ import java.util.List; import com.massivecraft.factions.Perm; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.ArgSetting; +import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -21,8 +21,8 @@ public class CmdFactionsFlagList extends FactionsCommand // Aliases this.addAliases("l", "list"); - // Args - this.addArg(ArgSetting.getPage()); + // Parameters + this.addParameter(Parameter.getPage()); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FLAG_LIST.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java index ac74f914..890acf58 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java @@ -1,15 +1,15 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.cmd.arg.ARMFlag; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMFlag; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.event.EventFactionsFlagChange; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARBoolean; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeBoolean; public class CmdFactionsFlagSet extends FactionsCommand { @@ -22,10 +22,10 @@ public class CmdFactionsFlagSet extends FactionsCommand // Aliases this.addAliases("set"); - // Args - this.addArg(ARMFlag.get(), "flag"); - this.addArg(ARBoolean.get(), "yes/no"); - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeMFlag.get(), "flag"); + this.addParameter(TypeBoolean.get(), "yes/no"); + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FLAG_SET.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java index fb4e2616..b2cefce1 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java @@ -5,14 +5,14 @@ import java.util.Collection; import java.util.List; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.cmd.arg.ARMFlag; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMFlag; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.massivecore.MassiveException; -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.cmd.type.TypeAll; +import com.massivecraft.massivecore.cmd.type.TypeSet; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsFlagShow extends FactionsCommand @@ -26,9 +26,9 @@ public class CmdFactionsFlagShow extends FactionsCommand // Aliases this.addAliases("s", "show"); - // Args - this.addArg(ARFaction.get(), "faction", "you"); - this.addArg(ARAll.get(ARSet.get(ARMFlag.get(), false)), "flags", "all", true); + // Parameters + this.addParameter(TypeFaction.get(), "faction", "you"); + this.addParameter(TypeAll.get(TypeSet.get(TypeMFlag.get(), false)), "flags", "all", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.FLAG_SHOW.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java index d59d8e4f..2daae2df 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java @@ -7,7 +7,7 @@ import org.bukkit.entity.Player; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MFlag; @@ -37,8 +37,8 @@ public class CmdFactionsHome extends FactionsCommandHome // Aliases this.addAliases("home"); - // Args - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.HOME.node)); @@ -73,7 +73,7 @@ public class CmdFactionsHome extends FactionsCommandHome if (MPerm.getPermSethome().has(msender, faction, false)) { msender.msg("You should:"); - msender.message(Factions.get().getOuterCmdFactions().cmdFactionsSethome.getUseageTemplate()); + msender.message(Factions.get().getOuterCmdFactions().cmdFactionsSethome.getTemplate()); } return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java index 25255ef5..7a1503b6 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java @@ -22,10 +22,10 @@ public class CmdFactionsInvite extends FactionsCommand // Aliases this.addAliases("i", "inv", "invite"); - // Add SubCommands - this.addSubCommand(this.cmdFactionsInviteAdd); - this.addSubCommand(this.cmdFactionsInviteRemove); - this.addSubCommand(this.cmdFactionsInviteList); + // Children + this.addChild(this.cmdFactionsInviteAdd); + this.addChild(this.cmdFactionsInviteRemove); + this.addChild(this.cmdFactionsInviteList); // Requirements diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java index 9e9067af..0ffded13 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java @@ -6,13 +6,13 @@ import org.bukkit.ChatColor; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.MPerm; 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.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeSet; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.Txt; @@ -26,8 +26,8 @@ public class CmdFactionsInviteAdd extends FactionsCommand // Aliases this.addAliases("a", "add"); - // Args - this.addArg(ARSet.get(ARMPlayer.get(), true), "players", true); + // Parameters + this.addParameter(TypeSet.get(TypeMPlayer.get(), true), "players", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.INVITE_ADD.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java index fe063a2b..58faa4bd 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java @@ -4,12 +4,12 @@ import java.util.List; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.ArgSetting; +import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; @@ -26,9 +26,9 @@ public class CmdFactionsInviteList extends FactionsCommand // Aliases this.addAliases("l", "list"); - // Args - this.addArg(ArgSetting.getPage()); - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(Parameter.getPage()); + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.INVITE_LIST.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java index 7791db3e..69d910f5 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java @@ -9,13 +9,13 @@ import org.bukkit.ChatColor; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.MPerm; 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.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeSet; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.Txt; @@ -29,8 +29,8 @@ public class CmdFactionsInviteRemove extends FactionsCommand // Aliases this.addAliases("r", "remove"); - // Args - this.addArg(ARSet.get(ARMPlayer.get(), true), "players/all", true); + // Parameters + this.addParameter(TypeSet.get(TypeMPlayer.get(), true), "players/all", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.INVITE_REMOVE.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java index f7e72634..e3e9271a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java @@ -4,8 +4,8 @@ import org.bukkit.ChatColor; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MPlayer; @@ -28,9 +28,9 @@ public class CmdFactionsJoin extends FactionsCommand // Aliases this.addAliases("join"); - // Args - this.addArg(ARFaction.get(), "faction"); - this.addArg(ARMPlayer.get(), "player", "you"); + // Parameters + this.addParameter(TypeFaction.get(), "faction"); + this.addParameter(TypeMPlayer.get(), "player", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.JOIN.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java index d25bfb31..fb0ca8f4 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -5,7 +5,7 @@ import org.bukkit.ChatColor; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARMPlayer; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; @@ -29,8 +29,8 @@ public class CmdFactionsKick extends FactionsCommand // Aliases this.addAliases("kick"); - // Args - this.addArg(ARMPlayer.get(), "player"); + // Parameters + this.addParameter(TypeMPlayer.get(), "player"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.KICK.node)); @@ -50,7 +50,7 @@ public class CmdFactionsKick extends FactionsCommand if (msender == mplayer) { msg("You can't kick yourself."); - message(Mson.mson(mson("You might want to: ").color(ChatColor.YELLOW), Factions.get().getOuterCmdFactions().cmdFactionsLeave.getUseageTemplate(false))); + message(Mson.mson(mson("You might want to: ").color(ChatColor.YELLOW), Factions.get().getOuterCmdFactions().cmdFactionsLeave.getTemplate(false))); return; } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/com/massivecraft/factions/cmd/CmdFactionsList.java index bfc82ac1..fbd1979f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -10,7 +10,7 @@ import com.massivecraft.factions.Perm; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.ArgSetting; +import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; @@ -27,8 +27,8 @@ public class CmdFactionsList extends FactionsCommand // Aliases this.addAliases("l", "list"); - // Args - this.addArg(ArgSetting.getPage()); + // Parameters + this.addParameter(Parameter.getPage()); // Requirements this.addRequirements(ReqHasPerm.get(Perm.LIST.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java index 0f060e7d..63b3200d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java @@ -8,9 +8,9 @@ import com.massivecraft.factions.Const; import com.massivecraft.factions.Perm; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARBoolean; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.ps.PS; public class CmdFactionsMap extends FactionsCommand @@ -24,8 +24,8 @@ public class CmdFactionsMap extends FactionsCommand // Aliases this.addAliases("map"); - // Args - this.addArg(ARBoolean.get(), "on/off", "once"); + // Parameters + this.addParameter(TypeBoolean.get(), "on/off", "once"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MAP.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoney.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoney.java index d38cd275..7ecfe08f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoney.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoney.java @@ -23,13 +23,13 @@ public class CmdFactionsMoney extends FactionsCommand public CmdFactionsMoney() { - // Add SubCommands - this.addSubCommand(this.cmdMoneyBalance); - this.addSubCommand(this.cmdMoneyDeposit); - this.addSubCommand(this.cmdMoneyWithdraw); - this.addSubCommand(this.cmdMoneyTransferFf); - this.addSubCommand(this.cmdMoneyTransferFp); - this.addSubCommand(this.cmdMoneyTransferPf); + // Children + this.addChild(this.cmdMoneyBalance); + this.addChild(this.cmdMoneyDeposit); + this.addChild(this.cmdMoneyWithdraw); + this.addChild(this.cmdMoneyTransferFf); + this.addChild(this.cmdMoneyTransferFp); + this.addChild(this.cmdMoneyTransferPf); // Aliases this.addAliases("money"); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java index 1f8b6d46..2d1d8a1f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.Perm; @@ -19,8 +19,8 @@ public class CmdFactionsMoneyBalance extends FactionsCommand // Aliases this.addAliases("b", "balance"); - // Args - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_BALANCE.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java index aac33641..b2524276 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java @@ -2,14 +2,14 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.integration.Econ; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARDouble; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -26,9 +26,9 @@ public class CmdFactionsMoneyDeposit extends FactionsCommand // Aliases this.addAliases("d", "deposit"); - // Args - this.addArg(ARDouble.get(), "amount"); - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeDouble.get(), "amount"); + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_DEPOSIT.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java index e9f6a7a3..949d9932 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java @@ -1,15 +1,15 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.Factions; import com.massivecraft.factions.integration.Econ; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARDouble; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -27,10 +27,10 @@ public class CmdFactionsMoneyTransferFf extends FactionsCommand // Aliases this.addAliases("ff"); - // Args - this.addArg(ARDouble.get(), "amount"); - this.addArg(ARFaction.get(), "faction"); - this.addArg(ARFaction.get(), "faction"); + // Parameters + this.addParameter(TypeDouble.get(), "amount"); + this.addParameter(TypeFaction.get(), "faction"); + this.addParameter(TypeFaction.get(), "faction"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2F.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java index 2613ddd5..933e6647 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java @@ -1,17 +1,17 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; -import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.Factions; import com.massivecraft.factions.integration.Econ; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARDouble; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -29,10 +29,10 @@ public class CmdFactionsMoneyTransferFp extends FactionsCommand // Aliases this.addAliases("fp"); - // Args - this.addArg(ARDouble.get(), "amount"); - this.addArg(ARFaction.get(), "faction"); - this.addArg(ARMPlayer.get(), "player"); + // Parameters + this.addParameter(TypeDouble.get(), "amount"); + this.addParameter(TypeFaction.get(), "faction"); + this.addParameter(TypeMPlayer.get(), "player"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2P.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java index f26cb80b..f79d2736 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java @@ -1,17 +1,17 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; -import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.Factions; import com.massivecraft.factions.integration.Econ; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARDouble; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -29,10 +29,10 @@ public class CmdFactionsMoneyTransferPf extends FactionsCommand // Aliases this.addAliases("pf"); - // Args - this.addArg(ARDouble.get(), "amount"); - this.addArg(ARMPlayer.get(), "player"); - this.addArg(ARFaction.get(), "faction"); + // Parameters + this.addParameter(TypeDouble.get(), "amount"); + this.addParameter(TypeMPlayer.get(), "player"); + this.addParameter(TypeFaction.get(), "faction"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_P2F.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java index f5c7d125..634644f8 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java @@ -1,16 +1,16 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.Factions; import com.massivecraft.factions.integration.Econ; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARDouble; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -28,9 +28,9 @@ public class CmdFactionsMoneyWithdraw extends FactionsCommand // Aliases this.addAliases("w", "withdraw"); - // Args - this.addArg(ARDouble.get(), "amount"); - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeDouble.get(), "amount"); + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MONEY_WITHDRAW.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java b/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java index 1a27fc42..73f350c8 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java @@ -6,8 +6,8 @@ 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.cmd.type.TypeString; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; @@ -23,8 +23,8 @@ public class CmdFactionsMotd extends FactionsCommand // Aliases this.addAliases("motd"); - // Args - this.addArg(ARString.get(), "new", "read", true); + // Parameters + this.addParameter(TypeString.get(), "new", "read", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.MOTD.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsName.java b/src/com/massivecraft/factions/cmd/CmdFactionsName.java index ffef356f..b700097d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsName.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsName.java @@ -3,15 +3,15 @@ package com.massivecraft.factions.cmd; import java.util.ArrayList; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; 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; +import com.massivecraft.massivecore.cmd.type.TypeString; public class CmdFactionsName extends FactionsCommand { @@ -24,9 +24,9 @@ public class CmdFactionsName extends FactionsCommand // Aliases this.addAliases("name"); - // Args - this.addArg(ARString.get(), "new name"); - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeString.get(), "new name"); + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.NAME.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java b/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java index bbc3825e..00701b98 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java @@ -22,10 +22,10 @@ public class CmdFactionsPerm extends FactionsCommand // Aliases this.addAliases("perm"); - // Subcommands - this.addSubCommand(this.cmdFactionsPermList); - this.addSubCommand(this.cmdFactionsPermShow); - this.addSubCommand(this.cmdFactionsPermSet); + // Children + this.addChild(this.cmdFactionsPermList); + this.addChild(this.cmdFactionsPermShow); + this.addChild(this.cmdFactionsPermSet); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PERM.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java index 5c749921..9d56ca09 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java @@ -6,7 +6,7 @@ import java.util.List; import com.massivecraft.factions.Perm; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.ArgSetting; +import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; @@ -21,8 +21,8 @@ public class CmdFactionsPermList extends FactionsCommand // Aliases this.addAliases("l", "list"); - // Args - this.addArg(ArgSetting.getPage()); + // Parameters + this.addParameter(Parameter.getPage()); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PERM_LIST.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java index 567ab07b..060f2ea8 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java @@ -5,15 +5,15 @@ import java.util.List; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.cmd.arg.ARMPerm; -import com.massivecraft.factions.cmd.arg.ARRel; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMPerm; +import com.massivecraft.factions.cmd.type.TypeRel; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARBoolean; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsPermSet extends FactionsCommand @@ -27,11 +27,11 @@ public class CmdFactionsPermSet extends FactionsCommand // Aliases this.addAliases("set"); - // Args - this.addArg(ARMPerm.get(), "perm"); - this.addArg(ARRel.get(), "relation"); - this.addArg(ARBoolean.get(), "yes/no"); - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeMPerm.get(), "perm"); + this.addParameter(TypeRel.get(), "relation"); + this.addParameter(TypeBoolean.get(), "yes/no"); + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PERM_SET.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java index baf5ac17..2b838d0d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java @@ -5,14 +5,14 @@ import java.util.Collection; import java.util.List; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.cmd.arg.ARMPerm; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMPerm; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.massivecore.MassiveException; -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.cmd.type.TypeAll; +import com.massivecraft.massivecore.cmd.type.TypeSet; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsPermShow extends FactionsCommand @@ -26,9 +26,9 @@ public class CmdFactionsPermShow extends FactionsCommand // Aliases this.addAliases("s", "show"); - // Args - this.addArg(ARFaction.get(), "faction", "you"); - this.addArg(ARAll.get(ARSet.get(ARMPerm.get(), false)), "perms", "all", true); + // Parameters + this.addParameter(TypeFaction.get(), "faction", "you"); + this.addParameter(TypeAll.get(TypeSet.get(TypeMPerm.get(), false)), "perms", "all", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PERM_SHOW.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java index 7fc9b38b..2fd2834c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java @@ -4,7 +4,7 @@ import java.util.LinkedHashMap; import java.util.Map.Entry; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsRemovePlayerMillis; @@ -26,8 +26,8 @@ public class CmdFactionsPlayer extends FactionsCommand // Aliases this.addAliases("p", "player"); - // Args - this.addArg(ARMPlayer.get(), "player", "you"); + // Parameters + this.addParameter(TypeMPlayer.get(), "player", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java index ac8077a4..1a42be1a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java @@ -2,15 +2,15 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMPlayer; 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.Parameter; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeDouble; +import com.massivecraft.massivecore.cmd.type.TypeString; public class CmdFactionsPowerBoost extends FactionsCommand { @@ -18,8 +18,8 @@ public class CmdFactionsPowerBoost extends FactionsCommand // FIELDS // -------------------------------------------- // - private ArgSetting settingMplayer = new ArgSetting(ARMPlayer.get(), "name"); - private ArgSetting settingFaction = new ArgSetting(ARFaction.get(), "name"); + private Parameter parameterMplayer = new Parameter(TypeMPlayer.get(), "name"); + private Parameter parameterFaction = new Parameter(TypeFaction.get(), "name"); // -------------------------------------------- // // CONSTRUCT @@ -30,10 +30,10 @@ public class CmdFactionsPowerBoost extends FactionsCommand // Aliases this.addAliases("powerboost"); - // Args - this.addArg(ARString.get(), "p|f|player|faction"); - this.addArg(settingMplayer); - this.addArg(ARDouble.get(), "#"); + // Parameters + this.addParameter(TypeString.get(), "p|f|player|faction"); + this.addParameter(parameterMplayer); + this.addParameter(TypeDouble.get(), "#"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.POWERBOOST.node)); @@ -65,7 +65,7 @@ public class CmdFactionsPowerBoost extends FactionsCommand if (doPlayer) { - this.getArgSettings().set(1, settingMplayer); + this.getParameters().set(1, parameterMplayer); MPlayer targetPlayer = this.readArgAt(1); targetPlayer.setPowerBoost(targetPower); @@ -73,7 +73,7 @@ public class CmdFactionsPowerBoost extends FactionsCommand } else { - this.getArgSettings().set(1, settingFaction); + this.getParameters().set(1, parameterFaction); Faction targetFaction = this.readArgAt(1); targetFaction.setPowerBoost(targetPower); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRank.java b/src/com/massivecraft/factions/cmd/CmdFactionsRank.java index b64b9e02..c146c818 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRank.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRank.java @@ -6,9 +6,9 @@ import java.util.Set; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.cmd.arg.ARMPlayer; -import com.massivecraft.factions.cmd.arg.ARRank; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMPlayer; +import com.massivecraft.factions.cmd.type.TypeRank; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MFlag; @@ -49,7 +49,7 @@ public class CmdFactionsRank extends FactionsCommand private Rel rank = null; // This one is permanent - private ARRank rankReader = new ARRank(); + private TypeRank rankReader = new TypeRank(); // -------------------------------------------- // // CONSTRUCT @@ -60,10 +60,10 @@ public class CmdFactionsRank extends FactionsCommand // Aliases this.addAliases("rank"); - // Args - this.addArg(ARMPlayer.get(), "player"); - this.addArg(rankReader, "action", "show"); - this.addArg(ARFaction.get(), "faction", "their"); + // Parameters + this.addParameter(TypeMPlayer.get(), "player"); + this.addParameter(rankReader, "action", "show"); + this.addParameter(TypeFaction.get(), "faction", "their"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.RANK.node)); @@ -113,10 +113,14 @@ public class CmdFactionsRank extends FactionsCommand // This is always run after performing a MassiveCommand. @Override - public void unsetSenderVars() + public void senderFields(boolean set) { - super.unsetSenderVars(); - this.unregisterFields(); + super.senderFields(set); + + if ( ! set) + { + this.unregisterFields(); + } } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java index 36278ec9..8ea7d882 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java @@ -1,9 +1,9 @@ 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.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeMPlayer; +import com.massivecraft.massivecore.cmd.Visibility; import com.massivecraft.massivecore.util.MUtil; public class CmdFactionsRankOld extends FactionsCommand @@ -26,12 +26,12 @@ public class CmdFactionsRankOld extends FactionsCommand // Aliases this.addAliases(rankName); - // Args - this.addArg(ARMPlayer.get(), "player"); - this.addArg(ARFaction.get(), "faction", "their"); + // Parameters + this.addParameter(TypeMPlayer.get(), "player"); + this.addParameter(TypeFaction.get(), "faction", "their"); - // VisibilityMode - this.setVisibilityMode(VisibilityMode.INVISIBLE); + // Visibility + this.setVisibility(Visibility.INVISIBLE); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java index a088e7bc..abbb0ea1 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java @@ -3,8 +3,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqHasFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MPerm; @@ -26,7 +26,7 @@ public abstract class CmdFactionsRelationAbstract extends FactionsCommand public CmdFactionsRelationAbstract() { // Aliases - this.addArg(ARFaction.get(), "faction"); + this.addParameter(TypeFaction.get(), "faction"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.RELATION.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java b/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java index 62a84f5c..c46ff945 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java @@ -2,9 +2,9 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARBoolean; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsSeeChunk extends FactionsCommand @@ -18,8 +18,8 @@ public class CmdFactionsSeeChunk extends FactionsCommand // Aliases this.addAliases("sc", "seechunk"); - // Args - this.addArg(ARBoolean.get(), "active", "toggle"); + // Parameters + this.addParameter(TypeBoolean.get(), "active", "toggle"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.SEECHUNK.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java index f0506815..8aff8b62 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java @@ -4,7 +4,7 @@ import java.util.Collections; import java.util.Set; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.MPerm; @@ -36,10 +36,10 @@ public class CmdFactionsSetAuto extends FactionsCommand // Aliases this.addAliases("a", "auto"); - // Args + // Parameters if (claim) { - this.addArg(ARFaction.get(), "faction", "you"); + this.addParameter(TypeFaction.get(), "faction", "you"); } // Requirements diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java index a7255ed7..e7c79756 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java @@ -1,9 +1,9 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARString; +import com.massivecraft.massivecore.cmd.type.TypeString; public abstract class CmdFactionsSetXAll extends CmdFactionsSetX { @@ -16,12 +16,12 @@ public abstract class CmdFactionsSetXAll extends CmdFactionsSetX // Super super(claim); - // Args - this.addArg(ARString.get(), "all|map"); - this.addArg(ARFaction.get(), "faction"); + // Parameters + this.addParameter(TypeString.get(), "all|map"); + this.addParameter(TypeFaction.get(), "faction"); if (claim) { - this.addArg(ARFaction.get(), "newfaction"); + this.addParameter(TypeFaction.get(), "newfaction"); this.setFactionArgIndex(2); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java index f75e9a79..e07f9c12 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java @@ -1,9 +1,9 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARInteger; +import com.massivecraft.massivecore.cmd.type.TypeInteger; public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX @@ -17,11 +17,11 @@ public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX // Super super(claim); - // Args - this.addArg(1, ARInteger.get(), "radius"); + // Parameters + this.addParameter(1, TypeInteger.get(), "radius"); if (claim) { - this.addArg(ARFaction.get(), "faction", "you"); + this.addParameter(TypeFaction.get(), "faction", "you"); this.setFactionArgIndex(1); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetXSimple.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetXSimple.java index 977feaa7..dd703a94 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetXSimple.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetXSimple.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; public abstract class CmdFactionsSetXSimple extends CmdFactionsSetX { @@ -13,10 +13,10 @@ public abstract class CmdFactionsSetXSimple extends CmdFactionsSetX // Super super(claim); - // Args + // Parameters if (claim) { - this.addArg(ARFaction.get(), "faction", "you"); + this.addParameter(TypeFaction.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 71fc0412..2376d3b0 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.event.EventFactionsHomeChange; @@ -22,8 +22,8 @@ public class CmdFactionsSethome extends FactionsCommandHome // Aliases this.addAliases("sethome"); - // Args - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.SETHOME.node)); @@ -63,7 +63,7 @@ public class CmdFactionsSethome extends FactionsCommandHome // Inform faction.msg("%s set the home for your faction. You can now use:", msender.describeTo(msenderFaction, true)); - faction.sendMessage(Factions.get().getOuterCmdFactions().cmdFactionsHome.getUseageTemplate()); + faction.sendMessage(Factions.get().getOuterCmdFactions().cmdFactionsHome.getTemplate()); if (faction != msenderFaction) { msender.msg("You have set the home for " + faction.getName(msender) + "."); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java index 21f04c49..d71f7979 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java @@ -1,13 +1,13 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsPowerChange; import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARDouble; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeDouble; public class CmdFactionsSetpower extends FactionsCommand { @@ -20,9 +20,9 @@ public class CmdFactionsSetpower extends FactionsCommand // Aliases this.addAliases("sp", "setpower"); - // Args - this.addArg(ARMPlayer.get(), "player"); - this.addArg(ARDouble.get(), "power"); + // Parameters + this.addParameter(TypeMPlayer.get(), "player"); + this.addParameter(TypeDouble.get(), "power"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.SETPOWER.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java b/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java index 370f5d90..33fa8da9 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java @@ -7,13 +7,13 @@ import java.util.List; import com.massivecraft.factions.Perm; import com.massivecraft.factions.PlayerInactivityComparator; -import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.cmd.arg.ARSortMPlayer; +import com.massivecraft.factions.cmd.type.TypeFaction; +import com.massivecraft.factions.cmd.type.TypeSortMPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.ArgSetting; +import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; @@ -33,10 +33,10 @@ public class CmdFactionsStatus extends FactionsCommand // Aliases this.addAliases("s", "status"); - // Args - this.addArg(ArgSetting.getPage()); - this.addArg(ARFaction.get(), "faction", "you"); - this.addArg(ARSortMPlayer.get(), "sort by", "time"); + // Parameters + this.addParameter(Parameter.getPage()); + this.addParameter(TypeFaction.get(), "faction", "you"); + this.addParameter(TypeSortMPlayer.get(), "sort by", "time"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.STATUS.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTerritorytitles.java b/src/com/massivecraft/factions/cmd/CmdFactionsTerritorytitles.java index 4efa7157..a07b7039 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsTerritorytitles.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsTerritorytitles.java @@ -2,10 +2,10 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.VisibilityMode; -import com.massivecraft.massivecore.cmd.arg.ARBoolean; +import com.massivecraft.massivecore.cmd.Visibility; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.cmd.req.ReqTitlesAvailable; +import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.util.Txt; @@ -20,8 +20,8 @@ public class CmdFactionsTerritorytitles extends FactionsCommand // Aliases this.addAliases("tt", "territorytitles"); - // Args - this.addArg(ARBoolean.get(), "on|off", "toggle"); + // Parameters + this.addParameter(TypeBoolean.get(), "on|off", "toggle"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.TERRITORYTITLES.node)); @@ -33,11 +33,11 @@ public class CmdFactionsTerritorytitles extends FactionsCommand // -------------------------------------------- // @Override - public VisibilityMode getVisibilityMode() + public Visibility getVisibility() { // We hide the command if titles aren't available. - if ( ! Mixin.isTitlesAvailable()) return VisibilityMode.INVISIBLE; - return super.getVisibilityMode(); + if ( ! Mixin.isTitlesAvailable()) return Visibility.INVISIBLE; + return super.getVisibility(); } @Override diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java index aab43d8b..413b78fc 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java @@ -3,13 +3,13 @@ package com.massivecraft.factions.cmd; import org.bukkit.ChatColor; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARMPlayer; +import com.massivecraft.factions.cmd.type.TypeMPlayer; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsTitleChange; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARString; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.cmd.type.TypeString; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsTitle extends FactionsCommand @@ -23,9 +23,9 @@ public class CmdFactionsTitle extends FactionsCommand // Aliases this.addAliases("title"); - // Args - this.addArg(ARMPlayer.get(), "player"); - this.addArg(ARString.get(), "title", "", true); + // Parameters + this.addParameter(TypeMPlayer.get(), "player"); + this.addParameter(TypeString.get(), "title", "", true); // Requirements this.addRequirements(ReqHasPerm.get(Perm.TITLE.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java index 07234147..27e440d1 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java @@ -26,13 +26,13 @@ public class CmdFactionsUnclaim extends FactionsCommand // Aliases this.addAliases("unclaim"); - // Add SubCommands - this.addSubCommand(this.cmdFactionsUnclaimOne); - this.addSubCommand(this.cmdFactionsUnclaimAuto); - this.addSubCommand(this.cmdFactionsUnclaimFill); - this.addSubCommand(this.cmdFactionsUnclaimSquare); - this.addSubCommand(this.cmdFactionsUnclaimCircle); - this.addSubCommand(this.cmdFactionsUnclaimAll); + // Children + this.addChild(this.cmdFactionsUnclaimOne); + this.addChild(this.cmdFactionsUnclaimAuto); + this.addChild(this.cmdFactionsUnclaimFill); + this.addChild(this.cmdFactionsUnclaimSquare); + this.addChild(this.cmdFactionsUnclaimCircle); + this.addChild(this.cmdFactionsUnclaimAll); // Requirements this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java index 2cc3feac..4abb224b 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFaction; +import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.event.EventFactionsHomeChange; @@ -19,8 +19,8 @@ public class CmdFactionsUnsethome extends FactionsCommandHome // Aliases this.addAliases("unsethome"); - // Args - this.addArg(ARFaction.get(), "faction", "you"); + // Parameters + this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.UNSETHOME.node)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java b/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java index f1f1db39..7fa5fa0a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java @@ -23,8 +23,8 @@ public class CmdFactionsXPlaceholder extends FactionsCommand // Desc this.setDesc("Use " + extensionName); - // Args - this.setGivingErrorOnTooManyArgs(false); + // Parameters + this.setOverflowSensitive(false); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/FactionsCommand.java b/src/com/massivecraft/factions/cmd/FactionsCommand.java index f5c3f6be..13685c9e 100644 --- a/src/com/massivecraft/factions/cmd/FactionsCommand.java +++ b/src/com/massivecraft/factions/cmd/FactionsCommand.java @@ -18,18 +18,10 @@ public class FactionsCommand extends MassiveCommand // -------------------------------------------- // @Override - public void fixSenderVars() + public void senderFields(boolean set) { - this.msender = MPlayer.get(sender); - this.msenderFaction = this.msender.getFaction(); - } - - - @Override - public void unsetSenderVars() - { - this.msender = null; - this.msenderFaction = null; + this.msender = set ? MPlayer.get(sender) : null; + this.msenderFaction = set ? this.msender.getFaction() : null; } } diff --git a/src/com/massivecraft/factions/cmd/FactionsCommandHome.java b/src/com/massivecraft/factions/cmd/FactionsCommandHome.java index 34247597..19c254c4 100644 --- a/src/com/massivecraft/factions/cmd/FactionsCommandHome.java +++ b/src/com/massivecraft/factions/cmd/FactionsCommandHome.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.cmd.req.ReqFactionHomesEnabled; import com.massivecraft.factions.entity.MConf; -import com.massivecraft.massivecore.cmd.VisibilityMode; +import com.massivecraft.massivecore.cmd.Visibility; public class FactionsCommandHome extends FactionsCommand { @@ -20,9 +20,9 @@ public class FactionsCommandHome extends FactionsCommand // -------------------------------------------- // @Override - public VisibilityMode getVisibilityMode() + public Visibility getVisibility() { - return MConf.get().homesEnabled ? super.getVisibilityMode() : VisibilityMode.INVISIBLE; + return MConf.get().homesEnabled ? super.getVisibility() : Visibility.INVISIBLE; } } diff --git a/src/com/massivecraft/factions/cmd/arg/ARFaction.java b/src/com/massivecraft/factions/cmd/type/TypeFaction.java similarity index 84% rename from src/com/massivecraft/factions/cmd/arg/ARFaction.java rename to src/com/massivecraft/factions/cmd/type/TypeFaction.java index 7ef55378..a7d1a1cf 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARFaction.java +++ b/src/com/massivecraft/factions/cmd/type/TypeFaction.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.cmd.arg; +package com.massivecraft.factions.cmd.type; import java.util.Collection; import java.util.Set; @@ -14,17 +14,17 @@ import com.massivecraft.factions.entity.MPlayerColl; 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.cmd.type.TypeAbstract; import com.massivecraft.massivecore.util.IdUtil; -public class ARFaction extends ARAbstract +public class TypeFaction extends TypeAbstract { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - private static ARFaction i = new ARFaction(); - public static ARFaction get() { return i; } + private static TypeFaction i = new TypeFaction(); + public static TypeFaction get() { return i; } // -------------------------------------------- // // OVERRIDE diff --git a/src/com/massivecraft/factions/cmd/arg/ARMFlag.java b/src/com/massivecraft/factions/cmd/type/TypeMFlag.java similarity index 80% rename from src/com/massivecraft/factions/cmd/arg/ARMFlag.java rename to src/com/massivecraft/factions/cmd/type/TypeMFlag.java index 05a34bbb..7941fba9 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARMFlag.java +++ b/src/com/massivecraft/factions/cmd/type/TypeMFlag.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.cmd.arg; +package com.massivecraft.factions.cmd.type; import java.util.ArrayList; import java.util.Collection; @@ -7,18 +7,18 @@ import java.util.List; 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.cmd.type.TypeAbstractSelect; +import com.massivecraft.massivecore.cmd.type.TypeAllAble; import com.massivecraft.massivecore.util.Txt; -public class ARMFlag extends ARAbstractSelect implements ARAllAble +public class TypeMFlag extends TypeAbstractSelect implements TypeAllAble { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - private static ARMFlag i = new ARMFlag(); - public static ARMFlag get() { return i; } + private static TypeMFlag i = new TypeMFlag(); + public static TypeMFlag get() { return i; } // -------------------------------------------- // // OVERRIDE diff --git a/src/com/massivecraft/factions/cmd/arg/ARMPerm.java b/src/com/massivecraft/factions/cmd/type/TypeMPerm.java similarity index 80% rename from src/com/massivecraft/factions/cmd/arg/ARMPerm.java rename to src/com/massivecraft/factions/cmd/type/TypeMPerm.java index 48a1351d..da3dbdca 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARMPerm.java +++ b/src/com/massivecraft/factions/cmd/type/TypeMPerm.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.cmd.arg; +package com.massivecraft.factions.cmd.type; import java.util.ArrayList; import java.util.Collection; @@ -7,18 +7,18 @@ import java.util.List; 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.cmd.type.TypeAbstractSelect; +import com.massivecraft.massivecore.cmd.type.TypeAllAble; import com.massivecraft.massivecore.util.Txt; -public class ARMPerm extends ARAbstractSelect implements ARAllAble +public class TypeMPerm extends TypeAbstractSelect implements TypeAllAble { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - private static ARMPerm i = new ARMPerm(); - public static ARMPerm get() { return i; } + private static TypeMPerm i = new TypeMPerm(); + public static TypeMPerm get() { return i; } // -------------------------------------------- // // OVERRIDE diff --git a/src/com/massivecraft/factions/cmd/arg/ARMPlayer.java b/src/com/massivecraft/factions/cmd/type/TypeMPlayer.java similarity index 51% rename from src/com/massivecraft/factions/cmd/arg/ARMPlayer.java rename to src/com/massivecraft/factions/cmd/type/TypeMPlayer.java index 29582385..123f98e9 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARMPlayer.java +++ b/src/com/massivecraft/factions/cmd/type/TypeMPlayer.java @@ -1,18 +1,18 @@ -package com.massivecraft.factions.cmd.arg; +package com.massivecraft.factions.cmd.type; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayerColl; -import com.massivecraft.massivecore.cmd.arg.AR; +import com.massivecraft.massivecore.cmd.type.Type; -public class ARMPlayer +public class TypeMPlayer { // -------------------------------------------- // // INSTANCE // -------------------------------------------- // - public static AR get() + public static Type get() { - return MPlayerColl.get().getAREntity(); + return MPlayerColl.get().getTypeEntity(); } } diff --git a/src/com/massivecraft/factions/cmd/arg/ARRank.java b/src/com/massivecraft/factions/cmd/type/TypeRank.java similarity index 91% rename from src/com/massivecraft/factions/cmd/arg/ARRank.java rename to src/com/massivecraft/factions/cmd/type/TypeRank.java index b6493b72..1e96f100 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARRank.java +++ b/src/com/massivecraft/factions/cmd/type/TypeRank.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.cmd.arg; +package com.massivecraft.factions.cmd.type; import java.util.Collection; import java.util.Collections; @@ -8,11 +8,11 @@ import org.bukkit.command.CommandSender; import com.massivecraft.factions.Rel; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.arg.ARAbstractSelect; +import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; -public class ARRank extends ARAbstractSelect +public class TypeRank extends TypeAbstractSelect { // -------------------------------------------- // // CONSTANTS @@ -32,18 +32,18 @@ public class ARRank extends ARAbstractSelect // -------------------------------------------- // // Default constructor. Can't use promote and demote. - private static ARRank i = new ARRank(); - public static ARRank get() { return i; } + private static TypeRank i = new TypeRank(); + public static TypeRank get() { return i; } - public ARRank() + public TypeRank() { this.startRank = null; } // Fancy constructor. Can use promote and demote. - public static ARRank get(Rel rank) { return new ARRank(rank); } + public static TypeRank get(Rel rank) { return new TypeRank(rank); } - public ARRank(Rel rank) + public TypeRank(Rel rank) { if (rank == null) throw new IllegalArgumentException("Do not use null, the default constructor can be used however."); if ( ! rank.isRank()) throw new IllegalArgumentException(rank + " is not a valid rank"); diff --git a/src/com/massivecraft/factions/cmd/arg/ARRel.java b/src/com/massivecraft/factions/cmd/type/TypeRel.java similarity index 75% rename from src/com/massivecraft/factions/cmd/arg/ARRel.java rename to src/com/massivecraft/factions/cmd/type/TypeRel.java index 36a912b9..639e8a52 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARRel.java +++ b/src/com/massivecraft/factions/cmd/type/TypeRel.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.cmd.arg; +package com.massivecraft.factions.cmd.type; import java.util.ArrayList; import java.util.Collection; @@ -7,17 +7,17 @@ import java.util.List; import org.bukkit.command.CommandSender; import com.massivecraft.factions.Rel; -import com.massivecraft.massivecore.cmd.arg.ARAbstractSelect; +import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; import com.massivecraft.massivecore.util.Txt; -public class ARRel extends ARAbstractSelect +public class TypeRel extends TypeAbstractSelect { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - private static ARRel i = new ARRel(); - public static ARRel get() { return i; } + private static TypeRel i = new TypeRel(); + public static TypeRel get() { return i; } // -------------------------------------------- // // OVERRIDE diff --git a/src/com/massivecraft/factions/cmd/arg/ARSortMPlayer.java b/src/com/massivecraft/factions/cmd/type/TypeSortMPlayer.java similarity index 81% rename from src/com/massivecraft/factions/cmd/arg/ARSortMPlayer.java rename to src/com/massivecraft/factions/cmd/type/TypeSortMPlayer.java index 5bbb6dd2..210d7180 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARSortMPlayer.java +++ b/src/com/massivecraft/factions/cmd/type/TypeSortMPlayer.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.cmd.arg; +package com.massivecraft.factions.cmd.type; import java.util.Collection; import java.util.Collections; @@ -11,10 +11,10 @@ import com.massivecraft.factions.PlayerInactivityComparator; import com.massivecraft.factions.PlayerPowerComparator; import com.massivecraft.factions.PlayerRoleComparator; import com.massivecraft.factions.entity.MPlayer; -import com.massivecraft.massivecore.cmd.arg.ARAbstractSelect; +import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; import com.massivecraft.massivecore.util.MUtil; -public class ARSortMPlayer extends ARAbstractSelect> +public class TypeSortMPlayer extends TypeAbstractSelect> { // -------------------------------------------- // // CONSTANTS @@ -26,8 +26,8 @@ public class ARSortMPlayer extends ARAbstractSelect> // INSTANCE & CONSTRUCT // -------------------------------------------- // - private static ARSortMPlayer i = new ARSortMPlayer(); - public static ARSortMPlayer get() { return i; } + private static TypeSortMPlayer i = new TypeSortMPlayer(); + public static TypeSortMPlayer get() { return i; } // -------------------------------------------- // // OVERRIDE diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index 8a2eeb19..9172d48f 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -8,7 +8,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.massivecraft.factions.EconomyParticipator; -import com.massivecraft.factions.FactionEqualsPredictate; +import com.massivecraft.factions.FactionEqualsPredicate; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Lang; import com.massivecraft.factions.Rel; @@ -1213,34 +1213,34 @@ public class Faction extends Entity implements EconomyParticipator public boolean sendMessage(Object message) { - return Mixin.messagePredictate(new FactionEqualsPredictate(this), message); + return Mixin.messagePredicate(new FactionEqualsPredicate(this), message); } public boolean sendMessage(Object... messages) { - return Mixin.messagePredictate(new FactionEqualsPredictate(this), messages); + return Mixin.messagePredicate(new FactionEqualsPredicate(this), messages); } public boolean sendMessage(Collection messages) { - return Mixin.messagePredictate(new FactionEqualsPredictate(this), messages); + return Mixin.messagePredicate(new FactionEqualsPredicate(this), messages); } // CONVENIENCE MSG public boolean msg(String msg) { - return Mixin.msgPredictate(new FactionEqualsPredictate(this), msg); + return Mixin.msgPredicate(new FactionEqualsPredicate(this), msg); } public boolean msg(String msg, Object... args) { - return Mixin.msgPredictate(new FactionEqualsPredictate(this), msg, args); + return Mixin.msgPredicate(new FactionEqualsPredicate(this), msg, args); } public boolean msg(Collection msgs) { - return Mixin.msgPredictate(new FactionEqualsPredictate(this), msgs); + return Mixin.msgPredicate(new FactionEqualsPredicate(this), msgs); } } diff --git a/src/com/massivecraft/factions/entity/MFlag.java b/src/com/massivecraft/factions/entity/MFlag.java index b3f91705..5d62572b 100644 --- a/src/com/massivecraft/factions/entity/MFlag.java +++ b/src/com/massivecraft/factions/entity/MFlag.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.entity; import java.util.List; import com.massivecraft.factions.event.EventFactionsCreateFlags; -import com.massivecraft.massivecore.PredictateIsRegistered; +import com.massivecraft.massivecore.PredicateIsRegistered; import com.massivecraft.massivecore.Prioritized; import com.massivecraft.massivecore.PriorityComparator; import com.massivecraft.massivecore.Registerable; @@ -63,7 +63,7 @@ public class MFlag extends Entity implements Prioritized, Registerable { setupStandardFlags(); new EventFactionsCreateFlags(isAsync).run(); - return MFlagColl.get().getAll(PredictateIsRegistered.get(), PriorityComparator.get()); + return MFlagColl.get().getAll(PredicateIsRegistered.get(), PriorityComparator.get()); } public static void setupStandardFlags() diff --git a/src/com/massivecraft/factions/entity/MPerm.java b/src/com/massivecraft/factions/entity/MPerm.java index 39eda97b..154ddf9c 100644 --- a/src/com/massivecraft/factions/entity/MPerm.java +++ b/src/com/massivecraft/factions/entity/MPerm.java @@ -12,7 +12,7 @@ import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.event.EventFactionsCreatePerms; -import com.massivecraft.massivecore.PredictateIsRegistered; +import com.massivecraft.massivecore.PredicateIsRegistered; import com.massivecraft.massivecore.Prioritized; import com.massivecraft.massivecore.PriorityComparator; import com.massivecraft.massivecore.Registerable; @@ -98,7 +98,7 @@ public class MPerm extends Entity implements Prioritized, Registerable setupStandardPerms(); new EventFactionsCreatePerms().run(); - return MPermColl.get().getAll(PredictateIsRegistered.get(), PriorityComparator.get()); + return MPermColl.get().getAll(PredicateIsRegistered.get(), PriorityComparator.get()); } public static void setupStandardPerms() @@ -297,7 +297,7 @@ public class MPerm extends Entity implements Prioritized, Registerable Player player = mplayer.getPlayer(); if (player != null && Perm.ADMIN.has(player)) { - ret += Txt.parse("\nYou can bypass by using " + Factions.get().getOuterCmdFactions().cmdFactionsAdmin.getUseageTemplate(false).toPlain(true)); + ret += Txt.parse("\nYou can bypass by using " + Factions.get().getOuterCmdFactions().cmdFactionsAdmin.getTemplate(false).toPlain(true)); } return ret;