diff --git a/README.md b/README.md index 0521d9ee..55545a68 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ - + ![Factions Logotype](https://raw.github.com/MassiveCraft/Factions/master/media/logo300.png)
-http://massivecraft.com/factions
+https://www.massivecraft.com/factions diff --git a/plugin.yml b/plugin.yml index 6f0c9c17..dbc93c40 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,9 +1,9 @@ main: com.massivecraft.factions.Factions name: Factions version: 2.8.2 -website: http://massivecraft.com/factions -authors: [Cayorion, Brettflan] -description: §eFactions allows the players to team up and claim land as their own and start wars with other factions. This way we hope to inspire politics, intrigue, and team spirit. §aCayorion §efrom the minecraft server §aMassiveCraft §eis the lead Factions programmer. Feel free to visit us at §bhttp://massivecraft.com +website: https://www.massivecraft.com/factions +authors: [Cayorion, Madus, Ulumulu1510, MarkehMe, Brettflan] +description: §eFactions allows the players to team up and claim land as their own and start wars with other factions. This way we hope to inspire politics, intrigue, and team spirit. §aCayorion §efrom the minecraft server §aMassiveCraft §eis the lead Factions programmer. Feel free to visit us at §bhttps://www.massivecraft.com depend: [MassiveCore] softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag] permissions: diff --git a/src/com/massivecraft/factions/PlayerInactivityComparator.java b/src/com/massivecraft/factions/PlayerInactivityComparator.java index 513e7717..f273c8c7 100644 --- a/src/com/massivecraft/factions/PlayerInactivityComparator.java +++ b/src/com/massivecraft/factions/PlayerInactivityComparator.java @@ -3,8 +3,9 @@ package com.massivecraft.factions; import java.util.Comparator; import com.massivecraft.factions.entity.MPlayer; +import com.massivecraft.massivecore.Named; -public class PlayerInactivityComparator implements Comparator +public class PlayerInactivityComparator implements Comparator, Named { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -13,6 +14,16 @@ public class PlayerInactivityComparator implements Comparator private static PlayerInactivityComparator i = new PlayerInactivityComparator(); public static PlayerInactivityComparator get() { return i; } + // -------------------------------------------- // + // OVERRIDE: NAMED + // -------------------------------------------- // + + @Override + public String getName() + { + return "Time"; + } + // -------------------------------------------- // // OVERRIDE: COMPARATOR // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/PlayerPowerComparator.java b/src/com/massivecraft/factions/PlayerPowerComparator.java index 763737f2..1b512bd0 100644 --- a/src/com/massivecraft/factions/PlayerPowerComparator.java +++ b/src/com/massivecraft/factions/PlayerPowerComparator.java @@ -3,8 +3,9 @@ package com.massivecraft.factions; import java.util.Comparator; import com.massivecraft.factions.entity.MPlayer; +import com.massivecraft.massivecore.Named; -public class PlayerPowerComparator implements Comparator +public class PlayerPowerComparator implements Comparator, Named { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -13,6 +14,16 @@ public class PlayerPowerComparator implements Comparator private static PlayerPowerComparator i = new PlayerPowerComparator(); public static PlayerPowerComparator get() { return i; } + // -------------------------------------------- // + // OVERRIDE: NAMED + // -------------------------------------------- // + + @Override + public String getName() + { + return "Power"; + } + // -------------------------------------------- // // OVERRIDE: COMPARATOR // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/PlayerRoleComparator.java b/src/com/massivecraft/factions/PlayerRoleComparator.java index 9c8d1206..d04ef2bc 100644 --- a/src/com/massivecraft/factions/PlayerRoleComparator.java +++ b/src/com/massivecraft/factions/PlayerRoleComparator.java @@ -3,8 +3,9 @@ package com.massivecraft.factions; import java.util.Comparator; import com.massivecraft.factions.entity.MPlayer; +import com.massivecraft.massivecore.Named; -public class PlayerRoleComparator implements Comparator +public class PlayerRoleComparator implements Comparator, Named { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -13,6 +14,16 @@ public class PlayerRoleComparator implements Comparator private static PlayerRoleComparator i = new PlayerRoleComparator(); public static PlayerRoleComparator get() { return i; } + // -------------------------------------------- // + // OVERRIDE: NAMED + // -------------------------------------------- // + + @Override + public String getName() + { + return "Rank"; + } + // -------------------------------------------- // // OVERRIDE: COMPARATOR // -------------------------------------------- // @@ -31,4 +42,6 @@ public class PlayerRoleComparator implements Comparator return r2.getValue() - r1.getValue(); } + + } diff --git a/src/com/massivecraft/factions/Rel.java b/src/com/massivecraft/factions/Rel.java index 070441bb..c9e1523b 100644 --- a/src/com/massivecraft/factions/Rel.java +++ b/src/com/massivecraft/factions/Rel.java @@ -65,37 +65,6 @@ public enum Rel // UTIL // -------------------------------------------- // - public static Rel parse(String str) - { - if (str == null || str.length() < 1) return null; - - str = str.toLowerCase(); - - // These are to allow conversion from the old system. - if (str.equals("admin")) - { - return LEADER; - } - - if (str.equals("moderator")) - { - return OFFICER; - } - - if (str.equals("normal")) - { - return MEMBER; - } - - // NOTE: This assumes the first char is different for all. - for (Rel rel : values()) - { - String relStr = rel.toString().toLowerCase(); - if (relStr.startsWith(str)) return rel; - } - return null; - } - public boolean isAtLeast(Rel rel) { return this.value >= rel.value; diff --git a/src/com/massivecraft/factions/adapter/RelAdapter.java b/src/com/massivecraft/factions/adapter/RelAdapter.java index bc56b4db..7c69edc2 100644 --- a/src/com/massivecraft/factions/adapter/RelAdapter.java +++ b/src/com/massivecraft/factions/adapter/RelAdapter.java @@ -3,6 +3,8 @@ package com.massivecraft.factions.adapter; import java.lang.reflect.Type; import com.massivecraft.factions.Rel; +import com.massivecraft.factions.cmd.type.TypeRel; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.xlib.gson.JsonDeserializationContext; import com.massivecraft.massivecore.xlib.gson.JsonDeserializer; import com.massivecraft.massivecore.xlib.gson.JsonElement; @@ -24,7 +26,14 @@ public class RelAdapter implements JsonDeserializer @Override public Rel deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return Rel.parse(json.getAsString()); + try + { + return TypeRel.get().read(json.getAsString()); + } + catch (MassiveException e) + { + return null; + } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactions.java b/src/com/massivecraft/factions/cmd/CmdFactions.java index 6aea0554..c37f9020 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactions.java +++ b/src/com/massivecraft/factions/cmd/CmdFactions.java @@ -5,8 +5,8 @@ import java.util.List; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.entity.MConf; -import com.massivecraft.massivecore.cmd.DeprecatedCommand; -import com.massivecraft.massivecore.cmd.VersionCommand; +import com.massivecraft.massivecore.command.DeprecatedCommand; +import com.massivecraft.massivecore.command.VersionCommand; public class CmdFactions extends FactionsCommand { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java index 0d504023..3ed7eaf2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java @@ -1,8 +1,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; public class CmdFactionsAccess extends FactionsCommand @@ -30,8 +30,8 @@ public class CmdFactionsAccess extends FactionsCommand this.addAliases("access"); // Requirements - this.addRequirements(ReqIsPlayer.get()); - this.addRequirements(ReqHasPerm.get(Perm.ACCESS.node)); + this.addRequirements(RequirementIsPlayer.get()); + this.addRequirements(RequirementHasPerm.get(Perm.ACCESS.node)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java index 93f80cc8..769cd8bc 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java @@ -9,7 +9,7 @@ import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PSFormatHumanSpace; import com.massivecraft.massivecore.util.Txt; @@ -32,7 +32,7 @@ public abstract class CmdFactionsAccessAbstract extends FactionsCommand public CmdFactionsAccessAbstract() { // Requirements - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementIsPlayer.get()); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java index de484488..628a70b8 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessFaction.java @@ -6,8 +6,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeBoolean; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract { @@ -22,10 +22,10 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract // Parameters this.addParameter(TypeFaction.get(), "faction"); - this.addParameter(TypeBoolean.get(), "yes/no", "toggle"); + this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.ACCESS_FACTION.node)); + this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_FACTION.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java index 1b0ec609..487d0c3a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java @@ -6,8 +6,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeBoolean; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract { @@ -22,10 +22,10 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract // Parameters this.addParameter(TypeMPlayer.get(), "player"); - this.addParameter(TypeBoolean.get(), "yes/no", "toggle"); + this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.ACCESS_PLAYER.node)); + this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_PLAYER.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessView.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessView.java index 69557e4e..8ff41146 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessView.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessView.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsAccessView extends CmdFactionsAccessAbstract { @@ -15,7 +15,7 @@ public class CmdFactionsAccessView extends CmdFactionsAccessAbstract this.addAliases("view"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.ACCESS_VIEW.node)); + this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_VIEW.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java b/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java index 084268fc..9c42c732 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeBoolean; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.Txt; @@ -20,10 +20,10 @@ public class CmdFactionsAdmin extends FactionsCommand this.addAliases("admin"); // Parameters - this.addParameter(TypeBoolean.get(), "on/off", "flip"); + this.addParameter(TypeBoolean.getOn(), "on/off", "flip"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.ADMIN.node)); + this.addRequirements(RequirementHasPerm.get(Perm.ADMIN.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java index 0236fdf1..6a1c39e2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsClaim extends FactionsCommand @@ -35,7 +35,7 @@ public class CmdFactionsClaim extends FactionsCommand this.addChild(this.cmdFactionsClaimAll); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.CLAIM.node)); + this.addRequirements(RequirementHasPerm.get(Perm.CLAIM.node)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java index 218f64d2..85053900 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeString; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeString; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.store.MStore; @@ -36,7 +36,7 @@ public class CmdFactionsCreate extends FactionsCommand // Requirements this.addRequirements(ReqHasntFaction.get()); - this.addRequirements(ReqHasPerm.get(Perm.CREATE.node)); + this.addRequirements(RequirementHasPerm.get(Perm.CREATE.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java index 0de63814..a8b77022 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeString; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeString; import com.massivecraft.massivecore.mixin.Mixin; public class CmdFactionsDescription extends FactionsCommand @@ -25,7 +25,7 @@ public class CmdFactionsDescription extends FactionsCommand this.addParameter(TypeString.get(), "desc", true); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node)); + this.addRequirements(RequirementHasPerm.get(Perm.DESCRIPTION.node)); this.addRequirements(ReqHasFaction.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java index 15234bac..a4a9488b 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java @@ -13,7 +13,7 @@ import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipC import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.Txt; @@ -32,7 +32,7 @@ public class CmdFactionsDisband extends FactionsCommand this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.DISBAND.node)); + this.addRequirements(RequirementHasPerm.get(Perm.DISBAND.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsExpansions.java b/src/com/massivecraft/factions/cmd/CmdFactionsExpansions.java index 236dd586..bf14ac85 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsExpansions.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsExpansions.java @@ -4,7 +4,7 @@ import java.util.Map.Entry; import com.massivecraft.factions.event.EventFactionsExpansions; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsExpansions extends FactionsCommand @@ -19,7 +19,7 @@ public class CmdFactionsExpansions extends FactionsCommand this.addAliases("expansions"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.EXPANSIONS.node)); + this.addRequirements(RequirementHasPerm.get(Perm.EXPANSIONS.node)); } // -------------------------------------------- // @@ -47,7 +47,7 @@ public class CmdFactionsExpansions extends FactionsCommand // URL Suggestion msg("Learn all about expansions in the online documentation:"); - msg("http://www.massivecraft.com/factions"); + msg("https://www.massivecraft.com/factions"); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java b/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java index 3dba9db7..ec1dcc26 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFaction.java @@ -12,7 +12,7 @@ import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.PriorityLines; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.util.Txt; @@ -31,7 +31,7 @@ public class CmdFactionsFaction extends FactionsCommand this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.FACTION.node)); + this.addRequirements(RequirementHasPerm.get(Perm.FACTION.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java index 6dcc4249..fed06d20 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsFlag extends FactionsCommand { @@ -28,7 +28,7 @@ public class CmdFactionsFlag extends FactionsCommand this.addChild(this.cmdFactionsFlagSet); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.FLAG.node)); + this.addRequirements(RequirementHasPerm.get(Perm.FLAG.node)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java index a82e1ab0..0a8c488b 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java @@ -6,8 +6,8 @@ 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.Parameter; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.Parameter; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsFlagList extends FactionsCommand @@ -25,7 +25,7 @@ public class CmdFactionsFlagList extends FactionsCommand this.addParameter(Parameter.getPage()); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.FLAG_LIST.node)); + this.addRequirements(RequirementHasPerm.get(Perm.FLAG_LIST.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java index 890acf58..d35fcf22 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java @@ -8,8 +8,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeBoolean; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; public class CmdFactionsFlagSet extends FactionsCommand { @@ -24,11 +24,11 @@ public class CmdFactionsFlagSet extends FactionsCommand // Parameters this.addParameter(TypeMFlag.get(), "flag"); - this.addParameter(TypeBoolean.get(), "yes/no"); + this.addParameter(TypeBoolean.getYes(), "yes/no"); this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.FLAG_SET.node)); + this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SET.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java index 40f4a289..7ead9106 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java @@ -10,9 +10,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeAll; -import com.massivecraft.massivecore.cmd.type.TypeSet; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.collection.TypeSet; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsFlagShow extends FactionsCommand @@ -28,10 +27,10 @@ public class CmdFactionsFlagShow extends FactionsCommand // Parameters this.addParameter(TypeFaction.get(), "faction", "you"); - this.addParameter(TypeAll.get(TypeSet.get(TypeMFlag.get(), false)), "flags", "all", true); + this.addParameter(TypeSet.get(TypeMFlag.get()), "flags", "all", true); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.FLAG_SHOW.node)); + this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SHOW.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java index 2daae2df..97dfa510 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java @@ -16,8 +16,8 @@ import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.event.EventFactionsHomeTeleport; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.mixin.TeleporterException; import com.massivecraft.massivecore.ps.PS; @@ -41,8 +41,8 @@ public class CmdFactionsHome extends FactionsCommandHome this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.HOME.node)); - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementHasPerm.get(Perm.HOME.node)); + this.addRequirements(RequirementIsPlayer.get()); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java index 9628160f..bfaa75b2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsInvite extends FactionsCommand { @@ -29,7 +29,7 @@ public class CmdFactionsInvite extends FactionsCommand // Requirements - this.addRequirements(ReqHasPerm.get(Perm.INVITE.node)); + this.addRequirements(RequirementHasPerm.get(Perm.INVITE.node)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java index fbcedad8..5b2ab7fe 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java @@ -11,8 +11,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeSet; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.collection.TypeSet; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.Txt; @@ -27,10 +27,10 @@ public class CmdFactionsInviteAdd extends FactionsCommand this.addAliases("add"); // Parameters - this.addParameter(TypeSet.get(TypeMPlayer.get(), true), "players", true); + this.addParameter(TypeSet.get(TypeMPlayer.get()), "players", true); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.INVITE_ADD.node)); + this.addRequirements(RequirementHasPerm.get(Perm.INVITE_ADD.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java index ea28fb32..a96a268c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteList.java @@ -9,8 +9,8 @@ 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.Parameter; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.Parameter; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; import com.massivecraft.massivecore.util.Txt; @@ -31,7 +31,7 @@ public class CmdFactionsInviteList extends FactionsCommand this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.INVITE_LIST.node)); + this.addRequirements(RequirementHasPerm.get(Perm.INVITE_LIST.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java index 79d6cfc5..c2535990 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java @@ -14,8 +14,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeSet; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.collection.TypeSet; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.Txt; @@ -30,10 +30,10 @@ public class CmdFactionsInviteRemove extends FactionsCommand this.addAliases("remove"); // Parameters - this.addParameter(TypeSet.get(TypeMPlayer.get(), true), "players/all", true); + this.addParameter(TypeSet.get(TypeMPlayer.get()), "players/all", true); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.INVITE_REMOVE.node)); + this.addRequirements(RequirementHasPerm.get(Perm.INVITE_REMOVE.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java index e3e9271a..6d0eed90 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java @@ -13,7 +13,7 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.Txt; @@ -33,7 +33,7 @@ public class CmdFactionsJoin extends FactionsCommand this.addParameter(TypeMPlayer.get(), "player", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.JOIN.node)); + this.addRequirements(RequirementHasPerm.get(Perm.JOIN.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java index fb0ca8f4..6c968228 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.IdUtil; @@ -33,7 +33,7 @@ public class CmdFactionsKick extends FactionsCommand this.addParameter(TypeMPlayer.get(), "player"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.KICK.node)); + this.addRequirements(RequirementHasPerm.get(Perm.KICK.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java b/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java index ebd4b44c..005f19ff 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.cmd.req.ReqHasFaction; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsLeave extends FactionsCommand { @@ -16,7 +16,7 @@ public class CmdFactionsLeave extends FactionsCommand this.addAliases("leave"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.LEAVE.node)); + this.addRequirements(RequirementHasPerm.get(Perm.LEAVE.node)); this.addRequirements(ReqHasFaction.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/com/massivecraft/factions/cmd/CmdFactionsList.java index fbd1979f..0bb7b67f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -10,8 +10,8 @@ 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.Parameter; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.Parameter; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; import com.massivecraft.massivecore.util.Txt; @@ -31,7 +31,7 @@ public class CmdFactionsList extends FactionsCommand this.addParameter(Parameter.getPage()); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.LIST.node)); + this.addRequirements(RequirementHasPerm.get(Perm.LIST.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java index 63b3200d..59069b81 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; -import com.massivecraft.massivecore.cmd.type.TypeBoolean; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; +import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; import com.massivecraft.massivecore.ps.PS; public class CmdFactionsMap extends FactionsCommand @@ -25,11 +25,11 @@ public class CmdFactionsMap extends FactionsCommand this.addAliases("map"); // Parameters - this.addParameter(TypeBoolean.get(), "on/off", "once"); + this.addParameter(TypeBoolean.getOn(), "on/off", "once"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.MAP.node)); - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementHasPerm.get(Perm.MAP.node)); + this.addRequirements(RequirementIsPlayer.get()); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoney.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoney.java index 7ecfe08f..32d14855 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoney.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoney.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsMoney extends FactionsCommand { @@ -36,7 +36,7 @@ public class CmdFactionsMoney extends FactionsCommand // Requirements this.addRequirements(ReqBankCommandsEnabled.get()); - this.addRequirements(ReqHasPerm.get(Perm.MONEY.node)); + this.addRequirements(RequirementHasPerm.get(Perm.MONEY.node)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java index 2748b8cb..8ad153c7 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java @@ -6,7 +6,7 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsMoneyBalance extends FactionsCommand { @@ -23,7 +23,7 @@ public class CmdFactionsMoneyBalance extends FactionsCommand this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.MONEY_BALANCE.node)); + this.addRequirements(RequirementHasPerm.get(Perm.MONEY_BALANCE.node)); this.addRequirements(ReqBankCommandsEnabled.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java index 13bb08c0..b2b46562 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java @@ -8,8 +8,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeDouble; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -31,7 +31,7 @@ public class CmdFactionsMoneyDeposit extends FactionsCommand this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.MONEY_DEPOSIT.node)); + this.addRequirements(RequirementHasPerm.get(Perm.MONEY_DEPOSIT.node)); this.addRequirements(ReqBankCommandsEnabled.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java index 949d9932..e7a14225 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java @@ -8,8 +8,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeDouble; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -33,7 +33,7 @@ public class CmdFactionsMoneyTransferFf extends FactionsCommand this.addParameter(TypeFaction.get(), "faction"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2F.node)); + this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2F.node)); this.addRequirements(ReqBankCommandsEnabled.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java index 933e6647..2d034f37 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java @@ -10,8 +10,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeDouble; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferFp extends FactionsCommand this.addParameter(TypeMPlayer.get(), "player"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2P.node)); + this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2P.node)); this.addRequirements(ReqBankCommandsEnabled.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java index f79d2736..12b9409f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java @@ -10,8 +10,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeDouble; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferPf extends FactionsCommand this.addParameter(TypeFaction.get(), "faction"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.MONEY_P2F.node)); + this.addRequirements(RequirementHasPerm.get(Perm.MONEY_P2F.node)); this.addRequirements(ReqBankCommandsEnabled.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java index ccefa444..4bb1b45f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java @@ -9,8 +9,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeDouble; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeDouble; import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.util.Txt; @@ -33,7 +33,7 @@ public class CmdFactionsMoneyWithdraw extends FactionsCommand this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.MONEY_WITHDRAW.node)); + this.addRequirements(RequirementHasPerm.get(Perm.MONEY_WITHDRAW.node)); this.addRequirements(ReqBankCommandsEnabled.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java b/src/com/massivecraft/factions/cmd/CmdFactionsMotd.java index 73f350c8..fba49714 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeString; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeString; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; @@ -27,7 +27,7 @@ public class CmdFactionsMotd extends FactionsCommand this.addParameter(TypeString.get(), "new", "read", true); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.MOTD.node)); + this.addRequirements(RequirementHasPerm.get(Perm.MOTD.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsName.java b/src/com/massivecraft/factions/cmd/CmdFactionsName.java index b700097d..269fc561 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsName.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsName.java @@ -10,8 +10,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeString; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeString; public class CmdFactionsName extends FactionsCommand { @@ -29,7 +29,7 @@ public class CmdFactionsName extends FactionsCommand this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.NAME.node)); + this.addRequirements(RequirementHasPerm.get(Perm.NAME.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java b/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java index 00701b98..c83db406 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsPerm extends FactionsCommand { @@ -28,7 +28,7 @@ public class CmdFactionsPerm extends FactionsCommand this.addChild(this.cmdFactionsPermSet); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.PERM.node)); + this.addRequirements(RequirementHasPerm.get(Perm.PERM.node)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java index 9859374d..1a376295 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermList.java @@ -6,8 +6,8 @@ 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.Parameter; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.Parameter; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsPermList extends FactionsCommand @@ -25,7 +25,7 @@ public class CmdFactionsPermList extends FactionsCommand this.addParameter(Parameter.getPage()); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.PERM_LIST.node)); + this.addRequirements(RequirementHasPerm.get(Perm.PERM_LIST.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java index 060f2ea8..39685e4a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermSet.java @@ -12,8 +12,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeBoolean; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsPermSet extends FactionsCommand @@ -30,11 +30,11 @@ public class CmdFactionsPermSet extends FactionsCommand // Parameters this.addParameter(TypeMPerm.get(), "perm"); this.addParameter(TypeRel.get(), "relation"); - this.addParameter(TypeBoolean.get(), "yes/no"); + this.addParameter(TypeBoolean.getYes(), "yes/no"); this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.PERM_SET.node)); + this.addRequirements(RequirementHasPerm.get(Perm.PERM_SET.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java index 09a15c1c..c20ea3d3 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java @@ -10,9 +10,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeAll; -import com.massivecraft.massivecore.cmd.type.TypeSet; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.collection.TypeSet; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsPermShow extends FactionsCommand @@ -28,10 +27,10 @@ public class CmdFactionsPermShow extends FactionsCommand // Parameters this.addParameter(TypeFaction.get(), "faction", "you"); - this.addParameter(TypeAll.get(TypeSet.get(TypeMPerm.get(), false)), "perms", "all", true); + this.addParameter(TypeSet.get(TypeMPerm.get()), "perms", "all", true); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.PERM_SHOW.node)); + this.addRequirements(RequirementHasPerm.get(Perm.PERM_SHOW.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java index 2fd2834c..0961f1dd 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java @@ -10,7 +10,7 @@ import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsRemovePlayerMillis; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.Progressbar; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.util.TimeDiffUtil; import com.massivecraft.massivecore.util.TimeUnit; import com.massivecraft.massivecore.util.Txt; @@ -30,7 +30,7 @@ public class CmdFactionsPlayer extends FactionsCommand this.addParameter(TypeMPlayer.get(), "player", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node)); + this.addRequirements(RequirementHasPerm.get(Perm.PLAYER.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java index 1a42be1a..cc9b89b6 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java @@ -7,10 +7,10 @@ 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.Parameter; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeDouble; -import com.massivecraft.massivecore.cmd.type.TypeString; +import com.massivecraft.massivecore.command.Parameter; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeDouble; +import com.massivecraft.massivecore.command.type.primitive.TypeString; public class CmdFactionsPowerBoost extends FactionsCommand { @@ -36,7 +36,7 @@ public class CmdFactionsPowerBoost extends FactionsCommand this.addParameter(TypeDouble.get(), "#"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.POWERBOOST.node)); + this.addRequirements(RequirementHasPerm.get(Perm.POWERBOOST.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRank.java b/src/com/massivecraft/factions/cmd/CmdFactionsRank.java index c146c818..83461b7c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRank.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRank.java @@ -18,7 +18,7 @@ import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.EventFactionsRankChange; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsRank extends FactionsCommand @@ -66,7 +66,7 @@ public class CmdFactionsRank extends FactionsCommand this.addParameter(TypeFaction.get(), "faction", "their"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.RANK.node)); + this.addRequirements(RequirementHasPerm.get(Perm.RANK.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java index 8ea7d882..b9d97b64 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRankOld.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.cmd.type.TypeMPlayer; -import com.massivecraft.massivecore.cmd.Visibility; +import com.massivecraft.massivecore.command.Visibility; import com.massivecraft.massivecore.util.MUtil; public class CmdFactionsRankOld extends FactionsCommand diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java index abbb0ea1..cad13ef0 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java @@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.event.EventFactionsRelationChange; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.MassiveCommand; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.Txt; @@ -29,7 +29,7 @@ public abstract class CmdFactionsRelationAbstract extends FactionsCommand this.addParameter(TypeFaction.get(), "faction"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.RELATION.node)); + this.addRequirements(RequirementHasPerm.get(Perm.RELATION.node)); this.addRequirements(ReqHasFaction.get()); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java b/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunk.java index c46ff945..e60ffcf5 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; -import com.massivecraft.massivecore.cmd.type.TypeBoolean; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; +import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsSeeChunk extends FactionsCommand @@ -19,11 +19,11 @@ public class CmdFactionsSeeChunk extends FactionsCommand this.addAliases("sc", "seechunk"); // Parameters - this.addParameter(TypeBoolean.get(), "active", "toggle"); + this.addParameter(TypeBoolean.getOn(), "active", "toggle"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.SEECHUNK.node)); - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNK.node)); + this.addRequirements(RequirementIsPlayer.get()); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunkOld.java b/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunkOld.java index 0d8461f0..da9593a5 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunkOld.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSeeChunkOld.java @@ -7,8 +7,8 @@ import org.bukkit.entity.Player; import com.massivecraft.factions.Perm; import com.massivecraft.factions.util.VisualizeUtil; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PSFormatHumanSpace; @@ -24,8 +24,8 @@ public class CmdFactionsSeeChunkOld extends FactionsCommand this.addAliases("sco", "seechunkold"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.SEECHUNKOLD.node)); - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNKOLD.node)); + this.addRequirements(RequirementIsPlayer.get()); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetAll.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetAll.java index df5c35ee..14c45783 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetAll.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetAll.java @@ -9,7 +9,7 @@ import com.massivecraft.factions.entity.Board; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.util.MUtil; @@ -38,7 +38,7 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll // Requirements String node = claim ? Perm.CLAIM_ALL.node : Perm.UNCLAIM_ALL.node; - this.addRequirements(ReqHasPerm.get(node)); + this.addRequirements(RequirementHasPerm.get(node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java index 59f589b4..ff1c38fb 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetAuto.java @@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; @@ -43,9 +43,9 @@ public class CmdFactionsSetAuto extends FactionsCommand } // Requirements - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementIsPlayer.get()); String node = claim ? Perm.CLAIM_AUTO.node : Perm.UNCLAIM_AUTO.node; - this.addRequirements(ReqHasPerm.get(node)); + this.addRequirements(RequirementHasPerm.get(node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetCircle.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetCircle.java index b4c21291..e88bd268 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetCircle.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetCircle.java @@ -5,8 +5,8 @@ import java.util.Set; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; @@ -29,9 +29,9 @@ public class CmdFactionsSetCircle extends CmdFactionsSetXRadius this.setFormatMany("%s %s %d chunks near %s using circle."); // Requirements - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementIsPlayer.get()); String node = claim ? Perm.CLAIM_CIRCLE.node : Perm.UNCLAIM_CIRCLE.node; - this.addRequirements(ReqHasPerm.get(node)); + this.addRequirements(RequirementHasPerm.get(node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java index 60941bce..234b4a82 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetFill.java @@ -7,8 +7,8 @@ import com.massivecraft.factions.Perm; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.util.MUtil; @@ -32,9 +32,9 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple this.setFormatMany("%s %s %d chunks near %s using fill."); // Requirements - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementIsPlayer.get()); String node = claim ? Perm.CLAIM_FILL.node : Perm.UNCLAIM_FILL.node; - this.addRequirements(ReqHasPerm.get(node)); + this.addRequirements(RequirementHasPerm.get(node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetOne.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetOne.java index 59636e4b..ab9d2a6c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetOne.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetOne.java @@ -4,8 +4,8 @@ import java.util.Collections; import java.util.Set; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; @@ -24,9 +24,9 @@ public class CmdFactionsSetOne extends CmdFactionsSetXSimple this.addAliases("one"); // Requirements - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementIsPlayer.get()); String node = claim ? Perm.CLAIM_ONE.node : Perm.UNCLAIM_ONE.node; - this.addRequirements(ReqHasPerm.get(node)); + this.addRequirements(RequirementHasPerm.get(node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetSquare.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetSquare.java index 5bc8ba4e..43f575ea 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetSquare.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetSquare.java @@ -5,8 +5,8 @@ import java.util.Set; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; @@ -29,9 +29,9 @@ public class CmdFactionsSetSquare extends CmdFactionsSetXRadius this.setFormatMany("%s %s %d chunks near %s using square."); // Requirements - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementIsPlayer.get()); String node = claim ? Perm.CLAIM_SQUARE.node : Perm.UNCLAIM_SQUARE.node; - this.addRequirements(ReqHasPerm.get(node)); + this.addRequirements(RequirementHasPerm.get(node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java index e7c79756..d9b042e8 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetXAll.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.type.TypeString; +import com.massivecraft.massivecore.command.type.primitive.TypeString; public abstract class CmdFactionsSetXAll extends CmdFactionsSetX { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java index e07f9c12..7bc5b14d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetXRadius.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.type.TypeInteger; +import com.massivecraft.massivecore.command.type.primitive.TypeInteger; public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java index 2376d3b0..b6c149ce 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java @@ -7,8 +7,8 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.event.EventFactionsHomeChange; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; public class CmdFactionsSethome extends FactionsCommandHome @@ -26,8 +26,8 @@ public class CmdFactionsSethome extends FactionsCommandHome this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.SETHOME.node)); - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementHasPerm.get(Perm.SETHOME.node)); + this.addRequirements(RequirementIsPlayer.get()); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java b/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java index d71f7979..8cde9226 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSetpower.java @@ -6,8 +6,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeDouble; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeDouble; public class CmdFactionsSetpower extends FactionsCommand { @@ -25,7 +25,7 @@ public class CmdFactionsSetpower extends FactionsCommand this.addParameter(TypeDouble.get(), "power"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.SETPOWER.node)); + this.addRequirements(RequirementHasPerm.get(Perm.SETPOWER.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java b/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java index 33fa8da9..021c22ba 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsStatus.java @@ -13,8 +13,8 @@ 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.Parameter; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.Parameter; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; import com.massivecraft.massivecore.util.TimeDiffUtil; @@ -39,7 +39,7 @@ public class CmdFactionsStatus extends FactionsCommand this.addParameter(TypeSortMPlayer.get(), "sort by", "time"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.STATUS.node)); + this.addRequirements(RequirementHasPerm.get(Perm.STATUS.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTerritorytitles.java b/src/com/massivecraft/factions/cmd/CmdFactionsTerritorytitles.java index a07b7039..b0b0a64a 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.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.command.Visibility; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementTitlesAvailable; +import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.util.Txt; @@ -21,11 +21,11 @@ public class CmdFactionsTerritorytitles extends FactionsCommand this.addAliases("tt", "territorytitles"); // Parameters - this.addParameter(TypeBoolean.get(), "on|off", "toggle"); + this.addParameter(TypeBoolean.getOn(), "on|off", "toggle"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.TERRITORYTITLES.node)); - this.addRequirements(ReqTitlesAvailable.get()); + this.addRequirements(RequirementHasPerm.get(Perm.TERRITORYTITLES.node)); + this.addRequirements(RequirementTitlesAvailable.get()); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java index 413b78fc..8a102f46 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java @@ -8,8 +8,8 @@ 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.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.type.TypeString; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.type.primitive.TypeString; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsTitle extends FactionsCommand @@ -28,7 +28,7 @@ public class CmdFactionsTitle extends FactionsCommand this.addParameter(TypeString.get(), "title", "", true); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.TITLE.node)); + this.addRequirements(RequirementHasPerm.get(Perm.TITLE.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java index 27e440d1..4d1e7f54 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsUnclaim extends FactionsCommand @@ -35,7 +35,7 @@ public class CmdFactionsUnclaim extends FactionsCommand this.addChild(this.cmdFactionsUnclaimAll); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node)); + this.addRequirements(RequirementHasPerm.get(Perm.UNCLAIM.node)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java index 4abb224b..9beb9a9d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnsethome.java @@ -6,7 +6,7 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.event.EventFactionsHomeChange; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; public class CmdFactionsUnsethome extends FactionsCommandHome { @@ -23,7 +23,7 @@ public class CmdFactionsUnsethome extends FactionsCommandHome this.addParameter(TypeFaction.get(), "faction", "you"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.UNSETHOME.node)); + this.addRequirements(RequirementHasPerm.get(Perm.UNSETHOME.node)); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnstuck.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnstuck.java index be20a32a..3e70c6c3 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnstuck.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnstuck.java @@ -14,8 +14,8 @@ import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.req.ReqHasPerm; -import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; +import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; +import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.mixin.TeleporterException; import com.massivecraft.massivecore.ps.PS; @@ -34,8 +34,8 @@ public class CmdFactionsUnstuck extends FactionsCommand this.addAliases("unstuck"); // Requirements - this.addRequirements(ReqHasPerm.get(Perm.UNSTUCK.node)); - this.addRequirements(ReqIsPlayer.get()); + this.addRequirements(RequirementHasPerm.get(Perm.UNSTUCK.node)); + this.addRequirements(RequirementIsPlayer.get()); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java b/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java index 7fa5fa0a..c9b6243d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsXPlaceholder.java @@ -36,7 +36,7 @@ public class CmdFactionsXPlaceholder extends FactionsCommand { msg("The extension %s isn't installed.", this.extensionName); msg("Learn more and download the extension here:"); - msg("http://www.massivecraft.com/%s", this.extensionName.toLowerCase()); + msg("https://www.massivecraft.com/%s", this.extensionName.toLowerCase()); } } diff --git a/src/com/massivecraft/factions/cmd/FactionsCommand.java b/src/com/massivecraft/factions/cmd/FactionsCommand.java index 13685c9e..a5fb8393 100644 --- a/src/com/massivecraft/factions/cmd/FactionsCommand.java +++ b/src/com/massivecraft/factions/cmd/FactionsCommand.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; -import com.massivecraft.massivecore.cmd.MassiveCommand; +import com.massivecraft.massivecore.command.MassiveCommand; public class FactionsCommand extends MassiveCommand { diff --git a/src/com/massivecraft/factions/cmd/FactionsCommandHome.java b/src/com/massivecraft/factions/cmd/FactionsCommandHome.java index 19c254c4..264d43cc 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.Visibility; +import com.massivecraft.massivecore.command.Visibility; public class FactionsCommandHome extends FactionsCommand { diff --git a/src/com/massivecraft/factions/cmd/req/ReqBankCommandsEnabled.java b/src/com/massivecraft/factions/cmd/req/ReqBankCommandsEnabled.java index 2022f589..48c0ea8d 100644 --- a/src/com/massivecraft/factions/cmd/req/ReqBankCommandsEnabled.java +++ b/src/com/massivecraft/factions/cmd/req/ReqBankCommandsEnabled.java @@ -4,11 +4,11 @@ import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.integration.Econ; -import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.req.ReqAbstract; +import com.massivecraft.massivecore.command.MassiveCommand; +import com.massivecraft.massivecore.command.requirement.RequirementAbstract; import com.massivecraft.massivecore.util.Txt; -public class ReqBankCommandsEnabled extends ReqAbstract +public class ReqBankCommandsEnabled extends RequirementAbstract { private static final long serialVersionUID = 1L; diff --git a/src/com/massivecraft/factions/cmd/req/ReqFactionHomesEnabled.java b/src/com/massivecraft/factions/cmd/req/ReqFactionHomesEnabled.java index 820f1885..bce28afe 100644 --- a/src/com/massivecraft/factions/cmd/req/ReqFactionHomesEnabled.java +++ b/src/com/massivecraft/factions/cmd/req/ReqFactionHomesEnabled.java @@ -3,11 +3,11 @@ package com.massivecraft.factions.cmd.req; import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MConf; -import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.req.ReqAbstract; +import com.massivecraft.massivecore.command.MassiveCommand; +import com.massivecraft.massivecore.command.requirement.RequirementAbstract; import com.massivecraft.massivecore.util.Txt; -public class ReqFactionHomesEnabled extends ReqAbstract +public class ReqFactionHomesEnabled extends RequirementAbstract { private static final long serialVersionUID = 1L; diff --git a/src/com/massivecraft/factions/cmd/req/ReqHasFaction.java b/src/com/massivecraft/factions/cmd/req/ReqHasFaction.java index d34e6271..de81afd4 100644 --- a/src/com/massivecraft/factions/cmd/req/ReqHasFaction.java +++ b/src/com/massivecraft/factions/cmd/req/ReqHasFaction.java @@ -3,12 +3,12 @@ package com.massivecraft.factions.cmd.req; import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MPlayer; -import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.req.ReqAbstract; +import com.massivecraft.massivecore.command.MassiveCommand; +import com.massivecraft.massivecore.command.requirement.RequirementAbstract; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; -public class ReqHasFaction extends ReqAbstract +public class ReqHasFaction extends RequirementAbstract { private static final long serialVersionUID = 1L; diff --git a/src/com/massivecraft/factions/cmd/req/ReqHasntFaction.java b/src/com/massivecraft/factions/cmd/req/ReqHasntFaction.java index 158f474d..9c8b1e1b 100644 --- a/src/com/massivecraft/factions/cmd/req/ReqHasntFaction.java +++ b/src/com/massivecraft/factions/cmd/req/ReqHasntFaction.java @@ -3,12 +3,12 @@ package com.massivecraft.factions.cmd.req; import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MPlayer; -import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.req.ReqAbstract; +import com.massivecraft.massivecore.command.MassiveCommand; +import com.massivecraft.massivecore.command.requirement.RequirementAbstract; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; -public class ReqHasntFaction extends ReqAbstract +public class ReqHasntFaction extends RequirementAbstract { private static final long serialVersionUID = 1L; diff --git a/src/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java b/src/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java index afbc654d..4f05ac95 100644 --- a/src/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java +++ b/src/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java @@ -4,12 +4,12 @@ import org.bukkit.command.CommandSender; import com.massivecraft.factions.Rel; import com.massivecraft.factions.entity.MPlayer; -import com.massivecraft.massivecore.cmd.MassiveCommand; -import com.massivecraft.massivecore.cmd.req.ReqAbstract; +import com.massivecraft.massivecore.command.MassiveCommand; +import com.massivecraft.massivecore.command.requirement.RequirementAbstract; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; -public class ReqRoleIsAtLeast extends ReqAbstract +public class ReqRoleIsAtLeast extends RequirementAbstract { private static final long serialVersionUID = 1L; diff --git a/src/com/massivecraft/factions/cmd/type/TypeFaction.java b/src/com/massivecraft/factions/cmd/type/TypeFaction.java index a7d1a1cf..009f2c4f 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeFaction.java +++ b/src/com/massivecraft/factions/cmd/type/TypeFaction.java @@ -14,7 +14,7 @@ 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.type.TypeAbstract; +import com.massivecraft.massivecore.command.type.TypeAbstract; import com.massivecraft.massivecore.util.IdUtil; public class TypeFaction extends TypeAbstract @@ -30,6 +30,18 @@ public class TypeFaction extends TypeAbstract // OVERRIDE // -------------------------------------------- // + @Override + public String getVisualInner(Faction value, CommandSender sender) + { + return value.describeTo(MPlayer.get(sender)); + } + + @Override + public String getNameInner(Faction value) + { + return ChatColor.stripColor(value.getName()); + } + @Override public Faction read(String str, CommandSender sender) throws MassiveException { diff --git a/src/com/massivecraft/factions/cmd/type/TypeMFlag.java b/src/com/massivecraft/factions/cmd/type/TypeMFlag.java index 7941fba9..4b0aa4ec 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeMFlag.java +++ b/src/com/massivecraft/factions/cmd/type/TypeMFlag.java @@ -1,17 +1,12 @@ package com.massivecraft.factions.cmd.type; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; - -import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MFlag; -import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; -import com.massivecraft.massivecore.cmd.type.TypeAllAble; -import com.massivecraft.massivecore.util.Txt; +import com.massivecraft.factions.entity.MFlagColl; +import com.massivecraft.massivecore.command.type.store.TypeEntity; -public class TypeMFlag extends TypeAbstractSelect implements TypeAllAble +public class TypeMFlag extends TypeEntity { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -19,6 +14,10 @@ public class TypeMFlag extends TypeAbstractSelect implements TypeAllAble< private static TypeMFlag i = new TypeMFlag(); public static TypeMFlag get() { return i; } + public TypeMFlag() + { + super(MFlagColl.get()); + } // -------------------------------------------- // // OVERRIDE @@ -31,71 +30,9 @@ public class TypeMFlag extends TypeAbstractSelect implements TypeAllAble< } @Override - public MFlag select(String arg, CommandSender sender) - { - if (arg == null) return null; - arg = getComparable(arg); - - // Algorithmic General Detection - int startswithCount = 0; - MFlag startswith = null; - for (MFlag mflag : MFlag.getAll()) - { - String comparable = getComparable(mflag); - if (comparable.equals(arg)) return mflag; - if (comparable.startsWith(arg)) - { - startswith = mflag; - startswithCount++; - } - } - - if (startswithCount == 1) - { - return startswith; - } - - // Nothing found - return null; - } - - @Override - public Collection altNames(CommandSender sender) - { - List ret = new ArrayList(); - - for (MFlag mflag : MFlag.getAll()) - { - ret.add(Txt.upperCaseFirst(mflag.getName())); - } - - return ret; - } - - @Override - public Collection getTabList(CommandSender sender, String arg) - { - return this.altNames(sender); - } - - @Override - public Collection getAll(CommandSender sender) + public Collection getAll() { return MFlag.getAll(); } - - // -------------------------------------------- // - // UTIL - // -------------------------------------------- // - - public static String getComparable(String string) - { - return string.toLowerCase(); - } - - public static String getComparable(MFlag mflag) - { - return getComparable(mflag.getName()); - } } diff --git a/src/com/massivecraft/factions/cmd/type/TypeMPerm.java b/src/com/massivecraft/factions/cmd/type/TypeMPerm.java index da3dbdca..7a08e8bf 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeMPerm.java +++ b/src/com/massivecraft/factions/cmd/type/TypeMPerm.java @@ -1,17 +1,12 @@ package com.massivecraft.factions.cmd.type; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; - -import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MPerm; -import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; -import com.massivecraft.massivecore.cmd.type.TypeAllAble; -import com.massivecraft.massivecore.util.Txt; +import com.massivecraft.factions.entity.MPermColl; +import com.massivecraft.massivecore.command.type.store.TypeEntity; -public class TypeMPerm extends TypeAbstractSelect implements TypeAllAble +public class TypeMPerm extends TypeEntity { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -19,6 +14,10 @@ public class TypeMPerm extends TypeAbstractSelect implements TypeAllAble< private static TypeMPerm i = new TypeMPerm(); public static TypeMPerm get() { return i; } + public TypeMPerm() + { + super(MPermColl.get()); + } // -------------------------------------------- // // OVERRIDE @@ -31,71 +30,10 @@ public class TypeMPerm extends TypeAbstractSelect implements TypeAllAble< } @Override - public MPerm select(String arg, CommandSender sender) - { - if (arg == null) return null; - arg = getComparable(arg); - - // Algorithmic General Detection - int startswithCount = 0; - MPerm startswith = null; - for (MPerm mperm : MPerm.getAll()) - { - String comparable = getComparable(mperm); - if (comparable.equals(arg)) return mperm; - if (comparable.startsWith(arg)) - { - startswith = mperm; - startswithCount++; - } - } - - if (startswithCount == 1) - { - return startswith; - } - - // Nothing found - return null; - } - - @Override - public Collection altNames(CommandSender sender) - { - List ret = new ArrayList(); - - for (MPerm mperm : MPerm.getAll()) - { - ret.add(Txt.upperCaseFirst(mperm.getName())); - } - - return ret; - } - - @Override - public Collection getTabList(CommandSender sender, String arg) - { - return this.altNames(sender); - } - - @Override - public Collection getAll(CommandSender sender) + public Collection getAll() { return MPerm.getAll(); } - // -------------------------------------------- // - // UTIL - // -------------------------------------------- // - - public static String getComparable(String string) - { - return string.toLowerCase(); - } - - public static String getComparable(MPerm mperm) - { - return getComparable(mperm.getName()); - } } diff --git a/src/com/massivecraft/factions/cmd/type/TypeMPlayer.java b/src/com/massivecraft/factions/cmd/type/TypeMPlayer.java index 123f98e9..66bffd20 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeMPlayer.java +++ b/src/com/massivecraft/factions/cmd/type/TypeMPlayer.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.type; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayerColl; -import com.massivecraft.massivecore.cmd.type.Type; +import com.massivecraft.massivecore.command.type.Type; public class TypeMPlayer { diff --git a/src/com/massivecraft/factions/cmd/type/TypeRank.java b/src/com/massivecraft/factions/cmd/type/TypeRank.java index 1e96f100..9c64dc39 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeRank.java +++ b/src/com/massivecraft/factions/cmd/type/TypeRank.java @@ -1,55 +1,52 @@ package com.massivecraft.factions.cmd.type; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.bukkit.command.CommandSender; +import java.util.Set; import com.massivecraft.factions.Rel; -import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; -import com.massivecraft.massivecore.util.MUtil; -import com.massivecraft.massivecore.util.Txt; +import com.massivecraft.massivecore.collections.MassiveSet; +import com.massivecraft.massivecore.command.type.enumeration.TypeEnum; -public class TypeRank extends TypeAbstractSelect +public class TypeRank extends TypeEnum { // -------------------------------------------- // // CONSTANTS // -------------------------------------------- // - public static final List ALT_NAMES = Collections.unmodifiableList(MUtil.list( - Txt.getNicedEnum(Rel.LEADER), - Txt.getNicedEnum(Rel.OFFICER), - Txt.getNicedEnum(Rel.MEMBER), - Txt.getNicedEnum(Rel.RECRUIT), - "Promote", - "Demote" - )); + public static final Set NAMES_PROMOTE = new MassiveSet( + "Promote", + "+", + "Plus", + "Up" + ); + public static final Set NAMES_DEMOTE = new MassiveSet( + "Demote", + "-", + "Minus", + "Down" + ); + // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - // Default constructor. Can't use promote and demote. - private static TypeRank i = new TypeRank(); - public static TypeRank get() { return i; } - - public TypeRank() - { - this.startRank = null; - } - - // Fancy constructor. Can use promote and demote. + // Can be used to promote and demote. public static TypeRank get(Rel rank) { return new TypeRank(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"); + super(Rel.class); + if (rank != null && ! rank.isRank()) throw new IllegalArgumentException(rank + " is not a valid rank"); this.startRank = rank; } + // Can not be used to promote and demote. + private static TypeRank i = new TypeRank(); + public static TypeRank get() { return i; } + public TypeRank() + { + this(null); + } + // -------------------------------------------- // // FIELDS // -------------------------------------------- // @@ -61,108 +58,50 @@ public class TypeRank extends TypeAbstractSelect // -------------------------------------------- // // OVERRIDE // -------------------------------------------- // - + @Override - public Rel select(String arg, CommandSender sender) throws MassiveException + public String getTypeName() { - // This is especially useful when one rank can have aliases. - // In the case of promote/demote, - // that would require 10 lines of code repeated for each alias. - arg = getComparable(arg); - - // All the normal ranks - if (arg.equals("leader")) return Rel.LEADER; - if (arg.equals("officer")) return Rel.OFFICER; - if (arg.equals("member")) return Rel.MEMBER; - if (arg.equals("recruit")) return Rel.RECRUIT; - - // No start rank? - if (startRank == null && (arg.equals("promote") || arg.equals("demote"))) - { - // This might happen if the default constructor is used - throw new MassiveException().addMsg("You can't use promote & demote."); - } - - // Promote - if (arg.equals("promote")) - { - if (Rel.LEADER.equals(startRank)) throw new MassiveException().addMsg("You can't promote the leader."); - if (Rel.OFFICER.equals(startRank)) return Rel.LEADER; - if (Rel.MEMBER.equals(startRank)) return Rel.OFFICER; - if (Rel.RECRUIT.equals(startRank)) return Rel.MEMBER; - } - - // Demote - if (arg.equals("demote")) - { - if (Rel.LEADER.equals(startRank)) return Rel.OFFICER; - if (Rel.OFFICER.equals(startRank)) return Rel.MEMBER; - if (Rel.MEMBER.equals(startRank)) return Rel.RECRUIT; - if (Rel.RECRUIT.equals(startRank)) throw new MassiveException().addMsg("You can't demote a recruit."); - } - - return null; - } - - @Override - public Collection altNames(CommandSender sender) - { - return ALT_NAMES; - } - - - @Override - public Collection getTabList(CommandSender sender, String arg) - { - return this.altNames(sender); + return "rank"; } @Override - public boolean isValid(String arg, CommandSender sender) + public Set getNamesInner(Rel value) { - try - { - return this.select(arg, sender) != null; - } - catch (MassiveException e) - { - return true; - } - } - - // -------------------------------------------- // - // ARG - // -------------------------------------------- // - - public static String getComparable(String str) - { - String ret = str.toLowerCase(); + // Create + Set ret = super.getNamesInner(value); - if (ret.startsWith("admin") || ret.startsWith("lea")) + // Fill Exact + if (value == Rel.LEADER) { - ret = "leader"; + ret.add("admin"); } - else if (ret.startsWith("mod") || ret.startsWith("off")) + else if (value == Rel.OFFICER) { - ret = "officer"; + ret.add("moderator"); } - else if (ret.startsWith("mem") || ret.startsWith("nor")) + else if (value == Rel.MEMBER) { - ret = "member"; - } - else if (ret.startsWith("rec")) - { - ret = "recruit"; - } - else if (ret.startsWith("+") || ret.startsWith("plus") || ret.startsWith("up")) - { - ret = "promote"; - } - else if (ret.startsWith("-") || ret.startsWith("minus") || ret.startsWith("down")) - { - ret = "demote"; + ret.add("member"); + ret.add("normal"); } + // Fill Relative + Rel start = this.getStartRank(); + if (start != null) + { + if (value == Rel.LEADER && start == Rel.OFFICER) ret.addAll(NAMES_PROMOTE); + + if (value == Rel.OFFICER && start == Rel.MEMBER) ret.addAll(NAMES_PROMOTE); + if (value == Rel.OFFICER && start == Rel.LEADER) ret.addAll(NAMES_DEMOTE); + + if (value == Rel.MEMBER && start == Rel.RECRUIT) ret.addAll(NAMES_PROMOTE); + if (value == Rel.MEMBER && start == Rel.OFFICER) ret.addAll(NAMES_DEMOTE); + + if (value == Rel.RECRUIT && start == Rel.MEMBER) ret.addAll(NAMES_DEMOTE); + } + + // Return return ret; } diff --git a/src/com/massivecraft/factions/cmd/type/TypeRel.java b/src/com/massivecraft/factions/cmd/type/TypeRel.java index 639e8a52..8fc1443d 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeRel.java +++ b/src/com/massivecraft/factions/cmd/type/TypeRel.java @@ -1,16 +1,11 @@ package com.massivecraft.factions.cmd.type; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.bukkit.command.CommandSender; +import java.util.Set; import com.massivecraft.factions.Rel; -import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; -import com.massivecraft.massivecore.util.Txt; +import com.massivecraft.massivecore.command.type.enumeration.TypeEnum; -public class TypeRel extends TypeAbstractSelect +public class TypeRel extends TypeEnum { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -18,6 +13,7 @@ public class TypeRel extends TypeAbstractSelect private static TypeRel i = new TypeRel(); public static TypeRel get() { return i; } + public TypeRel() { super(Rel.class); } // -------------------------------------------- // // OVERRIDE @@ -28,30 +24,26 @@ public class TypeRel extends TypeAbstractSelect { return "role"; } - + @Override - public Rel select(String str, CommandSender sender) + public Set getNamesInner(Rel value) { - return Rel.parse(str); - } - - @Override - public Collection altNames(CommandSender sender) - { - List ret = new ArrayList(); + Set ret = super.getNamesInner(value); - for (Rel rel : Rel.values()) + if (value == Rel.LEADER) { - ret.add(Txt.getNicedEnum(rel)); + ret.add("admin"); + } + else if (value == Rel.OFFICER) + { + ret.add("moderator"); + } + else if (value == Rel.MEMBER) + { + ret.add("normal"); } return ret; } - - @Override - public Collection getTabList(CommandSender sender, String arg) - { - return this.altNames(sender); - } } diff --git a/src/com/massivecraft/factions/cmd/type/TypeSortMPlayer.java b/src/com/massivecraft/factions/cmd/type/TypeSortMPlayer.java index 210d7180..019a3252 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeSortMPlayer.java +++ b/src/com/massivecraft/factions/cmd/type/TypeSortMPlayer.java @@ -1,27 +1,17 @@ package com.massivecraft.factions.cmd.type; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; -import java.util.List; - -import org.bukkit.command.CommandSender; 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.type.TypeAbstractSelect; -import com.massivecraft.massivecore.util.MUtil; +import com.massivecraft.massivecore.collections.MassiveList; +import com.massivecraft.massivecore.command.type.TypeAbstractChoice; -public class TypeSortMPlayer extends TypeAbstractSelect> +public class TypeSortMPlayer extends TypeAbstractChoice> { - // -------------------------------------------- // - // CONSTANTS - // -------------------------------------------- // - - public static final List ALT_NAMES = Collections.unmodifiableList(MUtil.list("rank", "power", "time")); - // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // @@ -39,40 +29,17 @@ public class TypeSortMPlayer extends TypeAbstractSelect> return "player sorter"; } + @SuppressWarnings("unchecked") @Override - public Comparator select(String sortedBy, CommandSender sender) + public Collection> getAll() { - sortedBy = sortedBy.toLowerCase(); - - if (sortedBy.startsWith("r")) - { - // Sort by rank - return PlayerRoleComparator.get(); - } - else if (sortedBy.startsWith("p")) - { - // Sort by power - return PlayerPowerComparator.get(); - } - else if (sortedBy.startsWith("t")) - { - // Sort by time - return PlayerInactivityComparator.get(); - } - - return null; + return new MassiveList>( + PlayerRoleComparator.get(), + PlayerPowerComparator.get(), + PlayerInactivityComparator.get() + ); } - @Override - public Collection altNames(CommandSender sender) - { - return ALT_NAMES; - } - - @Override - public Collection getTabList(CommandSender sender, String arg) - { - return this.altNames(sender); - } + } diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index 4f2ba4fa..8fac37b4 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -15,6 +15,7 @@ import com.massivecraft.factions.Rel; import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.util.*; import com.massivecraft.massivecore.CaseInsensitiveComparator; +import com.massivecraft.massivecore.Named; import com.massivecraft.massivecore.collections.MassiveMapDef; import com.massivecraft.massivecore.collections.MassiveTreeSetDef; import com.massivecraft.massivecore.mixin.Mixin; @@ -25,7 +26,7 @@ import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; -public class Faction extends Entity implements EconomyParticipator +public class Faction extends Entity implements EconomyParticipator, Named { // -------------------------------------------- // // META @@ -154,6 +155,7 @@ public class Faction extends Entity implements EconomyParticipator // RAW + @Override public String getName() { String ret = this.name; diff --git a/src/com/massivecraft/factions/entity/MFlag.java b/src/com/massivecraft/factions/entity/MFlag.java index 5d62572b..1ab5a956 100644 --- a/src/com/massivecraft/factions/entity/MFlag.java +++ b/src/com/massivecraft/factions/entity/MFlag.java @@ -3,6 +3,7 @@ package com.massivecraft.factions.entity; import java.util.List; import com.massivecraft.factions.event.EventFactionsCreateFlags; +import com.massivecraft.massivecore.Named; import com.massivecraft.massivecore.PredicateIsRegistered; import com.massivecraft.massivecore.Prioritized; import com.massivecraft.massivecore.PriorityComparator; @@ -11,7 +12,7 @@ import com.massivecraft.massivecore.collections.MassiveList; import com.massivecraft.massivecore.store.Entity; import com.massivecraft.massivecore.util.Txt; -public class MFlag extends Entity implements Prioritized, Registerable +public class MFlag extends Entity implements Prioritized, Registerable, Named { // -------------------------------------------- // // CONSTANTS @@ -158,7 +159,7 @@ public class MFlag extends Entity implements Prioritized, Registerable // I just added the name in case anyone feel like renaming their flags for some reason. // Example: "monsters" private String name = "defaultName"; - public String getName() { return this.name; } + @Override public String getName() { return this.name; } public MFlag setName(String name) { this.name = name; this.changed(); return this; } // The flag function described as a question. diff --git a/src/com/massivecraft/factions/entity/MPerm.java b/src/com/massivecraft/factions/entity/MPerm.java index 154ddf9c..5d4f04d4 100644 --- a/src/com/massivecraft/factions/entity/MPerm.java +++ b/src/com/massivecraft/factions/entity/MPerm.java @@ -12,6 +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.Named; import com.massivecraft.massivecore.PredicateIsRegistered; import com.massivecraft.massivecore.Prioritized; import com.massivecraft.massivecore.PriorityComparator; @@ -21,7 +22,7 @@ import com.massivecraft.massivecore.store.Entity; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; -public class MPerm extends Entity implements Prioritized, Registerable +public class MPerm extends Entity implements Prioritized, Registerable, Named { // -------------------------------------------- // // CONSTANTS @@ -216,7 +217,7 @@ public class MPerm extends Entity implements Prioritized, Registerable // I just added the name in case anyone feel like renaming their perms for some reason. // Example: "build" private String name = "defaultName"; - public String getName() { return this.name; } + @Override public String getName() { return this.name; } public MPerm setName(String name) { this.name = name; this.changed(); return this; } // The perm function described as an "order".