MassiveCore - More type. More editor.

This commit is contained in:
Olof Larsson 2015-11-06 02:10:29 +01:00
parent 53db58f582
commit 482b75be70
88 changed files with 391 additions and 591 deletions

View File

@ -1,3 +1,3 @@
<a href="http://massivecraft.com/factions"> <a href="https://www.massivecraft.com/factions">
![Factions Logotype](https://raw.github.com/MassiveCraft/Factions/master/media/logo300.png)<br> ![Factions Logotype](https://raw.github.com/MassiveCraft/Factions/master/media/logo300.png)<br>
<b>http://massivecraft.com/factions</b></a> <b>https://www.massivecraft.com/factions</b></a>

View File

@ -1,9 +1,9 @@
main: com.massivecraft.factions.Factions main: com.massivecraft.factions.Factions
name: Factions name: Factions
version: 2.8.2 version: 2.8.2
website: http://massivecraft.com/factions website: https://www.massivecraft.com/factions
authors: [Cayorion, Brettflan] 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 §bhttp://massivecraft.com 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] depend: [MassiveCore]
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag] softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag]
permissions: permissions:

View File

@ -3,8 +3,9 @@ package com.massivecraft.factions;
import java.util.Comparator; import java.util.Comparator;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.Named;
public class PlayerInactivityComparator implements Comparator<MPlayer> public class PlayerInactivityComparator implements Comparator<MPlayer>, Named
{ {
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
@ -13,6 +14,16 @@ public class PlayerInactivityComparator implements Comparator<MPlayer>
private static PlayerInactivityComparator i = new PlayerInactivityComparator(); private static PlayerInactivityComparator i = new PlayerInactivityComparator();
public static PlayerInactivityComparator get() { return i; } public static PlayerInactivityComparator get() { return i; }
// -------------------------------------------- //
// OVERRIDE: NAMED
// -------------------------------------------- //
@Override
public String getName()
{
return "Time";
}
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE: COMPARATOR // OVERRIDE: COMPARATOR
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -3,8 +3,9 @@ package com.massivecraft.factions;
import java.util.Comparator; import java.util.Comparator;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.Named;
public class PlayerPowerComparator implements Comparator<MPlayer> public class PlayerPowerComparator implements Comparator<MPlayer>, Named
{ {
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
@ -13,6 +14,16 @@ public class PlayerPowerComparator implements Comparator<MPlayer>
private static PlayerPowerComparator i = new PlayerPowerComparator(); private static PlayerPowerComparator i = new PlayerPowerComparator();
public static PlayerPowerComparator get() { return i; } public static PlayerPowerComparator get() { return i; }
// -------------------------------------------- //
// OVERRIDE: NAMED
// -------------------------------------------- //
@Override
public String getName()
{
return "Power";
}
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE: COMPARATOR // OVERRIDE: COMPARATOR
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -3,8 +3,9 @@ package com.massivecraft.factions;
import java.util.Comparator; import java.util.Comparator;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.Named;
public class PlayerRoleComparator implements Comparator<MPlayer> public class PlayerRoleComparator implements Comparator<MPlayer>, Named
{ {
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
@ -13,6 +14,16 @@ public class PlayerRoleComparator implements Comparator<MPlayer>
private static PlayerRoleComparator i = new PlayerRoleComparator(); private static PlayerRoleComparator i = new PlayerRoleComparator();
public static PlayerRoleComparator get() { return i; } public static PlayerRoleComparator get() { return i; }
// -------------------------------------------- //
// OVERRIDE: NAMED
// -------------------------------------------- //
@Override
public String getName()
{
return "Rank";
}
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE: COMPARATOR // OVERRIDE: COMPARATOR
// -------------------------------------------- // // -------------------------------------------- //
@ -31,4 +42,6 @@ public class PlayerRoleComparator implements Comparator<MPlayer>
return r2.getValue() - r1.getValue(); return r2.getValue() - r1.getValue();
} }
} }

View File

@ -65,37 +65,6 @@ public enum Rel
// UTIL // 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) public boolean isAtLeast(Rel rel)
{ {
return this.value >= rel.value; return this.value >= rel.value;

View File

@ -3,6 +3,8 @@ package com.massivecraft.factions.adapter;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import com.massivecraft.factions.Rel; 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.JsonDeserializationContext;
import com.massivecraft.massivecore.xlib.gson.JsonDeserializer; import com.massivecraft.massivecore.xlib.gson.JsonDeserializer;
import com.massivecraft.massivecore.xlib.gson.JsonElement; import com.massivecraft.massivecore.xlib.gson.JsonElement;
@ -24,7 +26,14 @@ public class RelAdapter implements JsonDeserializer<Rel>
@Override @Override
public Rel deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException 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;
}
} }
} }

View File

@ -5,8 +5,8 @@ import java.util.List;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.cmd.DeprecatedCommand; import com.massivecraft.massivecore.command.DeprecatedCommand;
import com.massivecraft.massivecore.cmd.VersionCommand; import com.massivecraft.massivecore.command.VersionCommand;
public class CmdFactions extends FactionsCommand public class CmdFactions extends FactionsCommand
{ {

View File

@ -1,8 +1,8 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
public class CmdFactionsAccess extends FactionsCommand public class CmdFactionsAccess extends FactionsCommand
@ -30,8 +30,8 @@ public class CmdFactionsAccess extends FactionsCommand
this.addAliases("access"); this.addAliases("access");
// Requirements // Requirements
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
this.addRequirements(ReqHasPerm.get(Perm.ACCESS.node)); this.addRequirements(RequirementHasPerm.get(Perm.ACCESS.node));
} }
} }

View File

@ -9,7 +9,7 @@ import com.massivecraft.factions.TerritoryAccess;
import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.massivecore.MassiveException; 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.PS;
import com.massivecraft.massivecore.ps.PSFormatHumanSpace; import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -32,7 +32,7 @@ public abstract class CmdFactionsAccessAbstract extends FactionsCommand
public CmdFactionsAccessAbstract() public CmdFactionsAccessAbstract()
{ {
// Requirements // Requirements
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract
{ {
@ -22,10 +22,10 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract
// Parameters // Parameters
this.addParameter(TypeFaction.get(), "faction"); this.addParameter(TypeFaction.get(), "faction");
this.addParameter(TypeBoolean.get(), "yes/no", "toggle"); this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_FACTION.node)); this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_FACTION.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract
{ {
@ -22,10 +22,10 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract
// Parameters // Parameters
this.addParameter(TypeMPlayer.get(), "player"); this.addParameter(TypeMPlayer.get(), "player");
this.addParameter(TypeBoolean.get(), "yes/no", "toggle"); this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_PLAYER.node)); this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_PLAYER.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactionsAccessView extends CmdFactionsAccessAbstract public class CmdFactionsAccessView extends CmdFactionsAccessAbstract
{ {
@ -15,7 +15,7 @@ public class CmdFactionsAccessView extends CmdFactionsAccessAbstract
this.addAliases("view"); this.addAliases("view");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_VIEW.node)); this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_VIEW.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -3,8 +3,8 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.IdUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -20,10 +20,10 @@ public class CmdFactionsAdmin extends FactionsCommand
this.addAliases("admin"); this.addAliases("admin");
// Parameters // Parameters
this.addParameter(TypeBoolean.get(), "on/off", "flip"); this.addParameter(TypeBoolean.getOn(), "on/off", "flip");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.ADMIN.node)); this.addRequirements(RequirementHasPerm.get(Perm.ADMIN.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactionsClaim extends FactionsCommand public class CmdFactionsClaim extends FactionsCommand
@ -35,7 +35,7 @@ public class CmdFactionsClaim extends FactionsCommand
this.addChild(this.cmdFactionsClaimAll); this.addChild(this.cmdFactionsClaimAll);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.CLAIM.node)); this.addRequirements(RequirementHasPerm.get(Perm.CLAIM.node));
} }
} }

View File

@ -15,8 +15,8 @@ import com.massivecraft.factions.event.EventFactionsCreate;
import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeString; import com.massivecraft.massivecore.command.type.primitive.TypeString;
import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.mson.Mson;
import com.massivecraft.massivecore.store.MStore; import com.massivecraft.massivecore.store.MStore;
@ -36,7 +36,7 @@ public class CmdFactionsCreate extends FactionsCommand
// Requirements // Requirements
this.addRequirements(ReqHasntFaction.get()); this.addRequirements(ReqHasntFaction.get());
this.addRequirements(ReqHasPerm.get(Perm.CREATE.node)); this.addRequirements(RequirementHasPerm.get(Perm.CREATE.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsDescriptionChange; import com.massivecraft.factions.event.EventFactionsDescriptionChange;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeString; import com.massivecraft.massivecore.command.type.primitive.TypeString;
import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.mixin.Mixin;
public class CmdFactionsDescription extends FactionsCommand public class CmdFactionsDescription extends FactionsCommand
@ -25,7 +25,7 @@ public class CmdFactionsDescription extends FactionsCommand
this.addParameter(TypeString.get(), "desc", true); this.addParameter(TypeString.get(), "desc", true);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node)); this.addRequirements(RequirementHasPerm.get(Perm.DESCRIPTION.node));
this.addRequirements(ReqHasFaction.get()); this.addRequirements(ReqHasFaction.get());
} }

View File

@ -13,7 +13,7 @@ import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipC
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.MassiveException; 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.IdUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -32,7 +32,7 @@ public class CmdFactionsDisband extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.DISBAND.node)); this.addRequirements(RequirementHasPerm.get(Perm.DISBAND.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -4,7 +4,7 @@ import java.util.Map.Entry;
import com.massivecraft.factions.event.EventFactionsExpansions; import com.massivecraft.factions.event.EventFactionsExpansions;
import com.massivecraft.factions.Perm; 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; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsExpansions extends FactionsCommand public class CmdFactionsExpansions extends FactionsCommand
@ -19,7 +19,7 @@ public class CmdFactionsExpansions extends FactionsCommand
this.addAliases("expansions"); this.addAliases("expansions");
// Requirements // 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 // URL Suggestion
msg("<i>Learn all about expansions in the online documentation:"); msg("<i>Learn all about expansions in the online documentation:");
msg("<aqua>http://www.massivecraft.com/factions"); msg("<aqua>https://www.massivecraft.com/factions");
} }
} }

View File

@ -12,7 +12,7 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.PriorityLines; 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.mixin.Mixin;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -31,7 +31,7 @@ public class CmdFactionsFaction extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.FACTION.node)); this.addRequirements(RequirementHasPerm.get(Perm.FACTION.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactionsFlag extends FactionsCommand public class CmdFactionsFlag extends FactionsCommand
{ {
@ -28,7 +28,7 @@ public class CmdFactionsFlag extends FactionsCommand
this.addChild(this.cmdFactionsFlagSet); this.addChild(this.cmdFactionsFlagSet);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.FLAG.node)); this.addRequirements(RequirementHasPerm.get(Perm.FLAG.node));
} }
} }

View File

@ -6,8 +6,8 @@ import java.util.List;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MFlag;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.command.Parameter;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsFlagList extends FactionsCommand public class CmdFactionsFlagList extends FactionsCommand
@ -25,7 +25,7 @@ public class CmdFactionsFlagList extends FactionsCommand
this.addParameter(Parameter.getPage()); this.addParameter(Parameter.getPage());
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.FLAG_LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.FLAG_LIST.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -8,8 +8,8 @@ import com.massivecraft.factions.entity.MFlag;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.event.EventFactionsFlagChange; import com.massivecraft.factions.event.EventFactionsFlagChange;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
public class CmdFactionsFlagSet extends FactionsCommand public class CmdFactionsFlagSet extends FactionsCommand
{ {
@ -24,11 +24,11 @@ public class CmdFactionsFlagSet extends FactionsCommand
// Parameters // Parameters
this.addParameter(TypeMFlag.get(), "flag"); this.addParameter(TypeMFlag.get(), "flag");
this.addParameter(TypeBoolean.get(), "yes/no"); this.addParameter(TypeBoolean.getYes(), "yes/no");
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.FLAG_SET.node)); this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SET.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -10,9 +10,8 @@ import com.massivecraft.factions.cmd.type.TypeMFlag;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MFlag;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeAll; import com.massivecraft.massivecore.command.type.collection.TypeSet;
import com.massivecraft.massivecore.cmd.type.TypeSet;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsFlagShow extends FactionsCommand public class CmdFactionsFlagShow extends FactionsCommand
@ -28,10 +27,10 @@ public class CmdFactionsFlagShow extends FactionsCommand
// Parameters // Parameters
this.addParameter(TypeFaction.get(), "faction", "you"); 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 // Requirements
this.addRequirements(ReqHasPerm.get(Perm.FLAG_SHOW.node)); this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SHOW.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -16,8 +16,8 @@ import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.event.EventFactionsHomeTeleport; import com.massivecraft.factions.event.EventFactionsHomeTeleport;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.mixin.Mixin;
import com.massivecraft.massivecore.mixin.TeleporterException; import com.massivecraft.massivecore.mixin.TeleporterException;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
@ -41,8 +41,8 @@ public class CmdFactionsHome extends FactionsCommandHome
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.HOME.node)); this.addRequirements(RequirementHasPerm.get(Perm.HOME.node));
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactionsInvite extends FactionsCommand public class CmdFactionsInvite extends FactionsCommand
{ {
@ -29,7 +29,7 @@ public class CmdFactionsInvite extends FactionsCommand
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.INVITE.node)); this.addRequirements(RequirementHasPerm.get(Perm.INVITE.node));
} }
} }

View File

@ -11,8 +11,8 @@ import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsInvitedChange; import com.massivecraft.factions.event.EventFactionsInvitedChange;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeSet; import com.massivecraft.massivecore.command.type.collection.TypeSet;
import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.mson.Mson;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -27,10 +27,10 @@ public class CmdFactionsInviteAdd extends FactionsCommand
this.addAliases("add"); this.addAliases("add");
// Parameters // Parameters
this.addParameter(TypeSet.get(TypeMPlayer.get(), true), "players", true); this.addParameter(TypeSet.get(TypeMPlayer.get()), "players", true);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.INVITE_ADD.node)); this.addRequirements(RequirementHasPerm.get(Perm.INVITE_ADD.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.command.Parameter;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Pager;
import com.massivecraft.massivecore.pager.Stringifier; import com.massivecraft.massivecore.pager.Stringifier;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -31,7 +31,7 @@ public class CmdFactionsInviteList extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.INVITE_LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.INVITE_LIST.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -14,8 +14,8 @@ import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsInvitedChange; import com.massivecraft.factions.event.EventFactionsInvitedChange;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeSet; import com.massivecraft.massivecore.command.type.collection.TypeSet;
import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.mson.Mson;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -30,10 +30,10 @@ public class CmdFactionsInviteRemove extends FactionsCommand
this.addAliases("remove"); this.addAliases("remove");
// Parameters // Parameters
this.addParameter(TypeSet.get(TypeMPlayer.get(), true), "players/all", true); this.addParameter(TypeSet.get(TypeMPlayer.get()), "players/all", true);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.INVITE_REMOVE.node)); this.addRequirements(RequirementHasPerm.get(Perm.INVITE_REMOVE.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -13,7 +13,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.massivecore.MassiveException; 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.mson.Mson;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -33,7 +33,7 @@ public class CmdFactionsJoin extends FactionsCommand
this.addParameter(TypeMPlayer.get(), "player", "you"); this.addParameter(TypeMPlayer.get(), "player", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.JOIN.node)); this.addRequirements(RequirementHasPerm.get(Perm.JOIN.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.massivecore.MassiveException; 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.mson.Mson;
import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.IdUtil;
@ -33,7 +33,7 @@ public class CmdFactionsKick extends FactionsCommand
this.addParameter(TypeMPlayer.get(), "player"); this.addParameter(TypeMPlayer.get(), "player");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.KICK.node)); this.addRequirements(RequirementHasPerm.get(Perm.KICK.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.cmd.req.ReqHasFaction; 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 public class CmdFactionsLeave extends FactionsCommand
{ {
@ -16,7 +16,7 @@ public class CmdFactionsLeave extends FactionsCommand
this.addAliases("leave"); this.addAliases("leave");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.LEAVE.node)); this.addRequirements(RequirementHasPerm.get(Perm.LEAVE.node));
this.addRequirements(ReqHasFaction.get()); this.addRequirements(ReqHasFaction.get());
} }

View File

@ -10,8 +10,8 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.command.Parameter;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Pager;
import com.massivecraft.massivecore.pager.Stringifier; import com.massivecraft.massivecore.pager.Stringifier;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -31,7 +31,7 @@ public class CmdFactionsList extends FactionsCommand
this.addParameter(Parameter.getPage()); this.addParameter(Parameter.getPage());
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.LIST.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -8,9 +8,9 @@ import com.massivecraft.factions.Const;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
public class CmdFactionsMap extends FactionsCommand public class CmdFactionsMap extends FactionsCommand
@ -25,11 +25,11 @@ public class CmdFactionsMap extends FactionsCommand
this.addAliases("map"); this.addAliases("map");
// Parameters // Parameters
this.addParameter(TypeBoolean.get(), "on/off", "once"); this.addParameter(TypeBoolean.getOn(), "on/off", "once");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.MAP.node)); this.addRequirements(RequirementHasPerm.get(Perm.MAP.node));
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; 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 public class CmdFactionsMoney extends FactionsCommand
{ {
@ -36,7 +36,7 @@ public class CmdFactionsMoney extends FactionsCommand
// Requirements // Requirements
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY.node));
} }
} }

View File

@ -6,7 +6,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactionsMoneyBalance extends FactionsCommand public class CmdFactionsMoneyBalance extends FactionsCommand
{ {
@ -23,7 +23,7 @@ public class CmdFactionsMoneyBalance extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.MONEY_BALANCE.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_BALANCE.node));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -8,8 +8,8 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.money.Money;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -31,7 +31,7 @@ public class CmdFactionsMoneyDeposit extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.MONEY_DEPOSIT.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_DEPOSIT.node));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -8,8 +8,8 @@ import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.money.Money;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -33,7 +33,7 @@ public class CmdFactionsMoneyTransferFf extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction"); this.addParameter(TypeFaction.get(), "faction");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2F.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2F.node));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.money.Money;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferFp extends FactionsCommand
this.addParameter(TypeMPlayer.get(), "player"); this.addParameter(TypeMPlayer.get(), "player");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2P.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2P.node));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.money.Money;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferPf extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction"); this.addParameter(TypeFaction.get(), "faction");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.MONEY_P2F.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_P2F.node));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
import com.massivecraft.massivecore.money.Money; import com.massivecraft.massivecore.money.Money;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -33,7 +33,7 @@ public class CmdFactionsMoneyWithdraw extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.MONEY_WITHDRAW.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_WITHDRAW.node));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsMotdChange; import com.massivecraft.factions.event.EventFactionsMotdChange;
import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveCore;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeString; import com.massivecraft.massivecore.command.type.primitive.TypeString;
import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.mixin.Mixin;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -27,7 +27,7 @@ public class CmdFactionsMotd extends FactionsCommand
this.addParameter(TypeString.get(), "new", "read", true); this.addParameter(TypeString.get(), "new", "read", true);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.MOTD.node)); this.addRequirements(RequirementHasPerm.get(Perm.MOTD.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.event.EventFactionsNameChange; import com.massivecraft.factions.event.EventFactionsNameChange;
import com.massivecraft.factions.util.MiscUtil; import com.massivecraft.factions.util.MiscUtil;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeString; import com.massivecraft.massivecore.command.type.primitive.TypeString;
public class CmdFactionsName extends FactionsCommand public class CmdFactionsName extends FactionsCommand
{ {
@ -29,7 +29,7 @@ public class CmdFactionsName extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.NAME.node)); this.addRequirements(RequirementHasPerm.get(Perm.NAME.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactionsPerm extends FactionsCommand public class CmdFactionsPerm extends FactionsCommand
{ {
@ -28,7 +28,7 @@ public class CmdFactionsPerm extends FactionsCommand
this.addChild(this.cmdFactionsPermSet); this.addChild(this.cmdFactionsPermSet);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.PERM.node)); this.addRequirements(RequirementHasPerm.get(Perm.PERM.node));
} }
} }

View File

@ -6,8 +6,8 @@ import java.util.List;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.command.Parameter;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsPermList extends FactionsCommand public class CmdFactionsPermList extends FactionsCommand
@ -25,7 +25,7 @@ public class CmdFactionsPermList extends FactionsCommand
this.addParameter(Parameter.getPage()); this.addParameter(Parameter.getPage());
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.PERM_LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.PERM_LIST.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -12,8 +12,8 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsPermSet extends FactionsCommand public class CmdFactionsPermSet extends FactionsCommand
@ -30,11 +30,11 @@ public class CmdFactionsPermSet extends FactionsCommand
// Parameters // Parameters
this.addParameter(TypeMPerm.get(), "perm"); this.addParameter(TypeMPerm.get(), "perm");
this.addParameter(TypeRel.get(), "relation"); this.addParameter(TypeRel.get(), "relation");
this.addParameter(TypeBoolean.get(), "yes/no"); this.addParameter(TypeBoolean.getYes(), "yes/no");
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.PERM_SET.node)); this.addRequirements(RequirementHasPerm.get(Perm.PERM_SET.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -10,9 +10,8 @@ import com.massivecraft.factions.cmd.type.TypeMPerm;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeAll; import com.massivecraft.massivecore.command.type.collection.TypeSet;
import com.massivecraft.massivecore.cmd.type.TypeSet;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsPermShow extends FactionsCommand public class CmdFactionsPermShow extends FactionsCommand
@ -28,10 +27,10 @@ public class CmdFactionsPermShow extends FactionsCommand
// Parameters // Parameters
this.addParameter(TypeFaction.get(), "faction", "you"); 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 // Requirements
this.addRequirements(ReqHasPerm.get(Perm.PERM_SHOW.node)); this.addRequirements(RequirementHasPerm.get(Perm.PERM_SHOW.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -10,7 +10,7 @@ import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsRemovePlayerMillis; import com.massivecraft.factions.event.EventFactionsRemovePlayerMillis;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.Progressbar; 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.TimeDiffUtil;
import com.massivecraft.massivecore.util.TimeUnit; import com.massivecraft.massivecore.util.TimeUnit;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -30,7 +30,7 @@ public class CmdFactionsPlayer extends FactionsCommand
this.addParameter(TypeMPlayer.get(), "player", "you"); this.addParameter(TypeMPlayer.get(), "player", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node)); this.addRequirements(RequirementHasPerm.get(Perm.PLAYER.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -7,10 +7,10 @@ import com.massivecraft.factions.cmd.type.TypeMPlayer;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.command.Parameter;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
import com.massivecraft.massivecore.cmd.type.TypeString; import com.massivecraft.massivecore.command.type.primitive.TypeString;
public class CmdFactionsPowerBoost extends FactionsCommand public class CmdFactionsPowerBoost extends FactionsCommand
{ {
@ -36,7 +36,7 @@ public class CmdFactionsPowerBoost extends FactionsCommand
this.addParameter(TypeDouble.get(), "#"); this.addParameter(TypeDouble.get(), "#");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.POWERBOOST.node)); this.addRequirements(RequirementHasPerm.get(Perm.POWERBOOST.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -18,7 +18,7 @@ import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.EventFactionsRankChange; import com.massivecraft.factions.event.EventFactionsRankChange;
import com.massivecraft.massivecore.MassiveException; 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; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsRank extends FactionsCommand public class CmdFactionsRank extends FactionsCommand
@ -66,7 +66,7 @@ public class CmdFactionsRank extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "their"); this.addParameter(TypeFaction.get(), "faction", "their");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.RANK.node)); this.addRequirements(RequirementHasPerm.get(Perm.RANK.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.cmd.type.TypeFaction;
import com.massivecraft.factions.cmd.type.TypeMPlayer; 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; import com.massivecraft.massivecore.util.MUtil;
public class CmdFactionsRankOld extends FactionsCommand public class CmdFactionsRankOld extends FactionsCommand

View File

@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MFlag;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.event.EventFactionsRelationChange; import com.massivecraft.factions.event.EventFactionsRelationChange;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.MassiveCommand; import com.massivecraft.massivecore.command.MassiveCommand;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.mson.Mson;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -29,7 +29,7 @@ public abstract class CmdFactionsRelationAbstract extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction"); this.addParameter(TypeFaction.get(), "faction");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.RELATION.node)); this.addRequirements(RequirementHasPerm.get(Perm.RELATION.node));
this.addRequirements(ReqHasFaction.get()); this.addRequirements(ReqHasFaction.get());
} }

View File

@ -2,9 +2,9 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsSeeChunk extends FactionsCommand public class CmdFactionsSeeChunk extends FactionsCommand
@ -19,11 +19,11 @@ public class CmdFactionsSeeChunk extends FactionsCommand
this.addAliases("sc", "seechunk"); this.addAliases("sc", "seechunk");
// Parameters // Parameters
this.addParameter(TypeBoolean.get(), "active", "toggle"); this.addParameter(TypeBoolean.getOn(), "active", "toggle");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.SEECHUNK.node)); this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNK.node));
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -7,8 +7,8 @@ import org.bukkit.entity.Player;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.util.VisualizeUtil; import com.massivecraft.factions.util.VisualizeUtil;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
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.PS;
import com.massivecraft.massivecore.ps.PSFormatHumanSpace; import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
@ -24,8 +24,8 @@ public class CmdFactionsSeeChunkOld extends FactionsCommand
this.addAliases("sco", "seechunkold"); this.addAliases("sco", "seechunkold");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.SEECHUNKOLD.node)); this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNKOLD.node));
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -9,7 +9,7 @@ import com.massivecraft.factions.entity.Board;
import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.massivecore.MassiveException; 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.mixin.Mixin;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
@ -38,7 +38,7 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll
// Requirements // Requirements
String node = claim ? Perm.CLAIM_ALL.node : Perm.UNCLAIM_ALL.node; String node = claim ? Perm.CLAIM_ALL.node : Perm.UNCLAIM_ALL.node;
this.addRequirements(ReqHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
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.PS;
@ -43,9 +43,9 @@ public class CmdFactionsSetAuto extends FactionsCommand
} }
// Requirements // Requirements
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_AUTO.node : Perm.UNCLAIM_AUTO.node; String node = claim ? Perm.CLAIM_AUTO.node : Perm.UNCLAIM_AUTO.node;
this.addRequirements(ReqHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -5,8 +5,8 @@ import java.util.Set;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
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.PS;
@ -29,9 +29,9 @@ public class CmdFactionsSetCircle extends CmdFactionsSetXRadius
this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using circle."); this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using circle.");
// Requirements // Requirements
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_CIRCLE.node : Perm.UNCLAIM_CIRCLE.node; String node = claim ? Perm.CLAIM_CIRCLE.node : Perm.UNCLAIM_CIRCLE.node;
this.addRequirements(ReqHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -7,8 +7,8 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
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.PS;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
@ -32,9 +32,9 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using fill."); this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using fill.");
// Requirements // Requirements
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_FILL.node : Perm.UNCLAIM_FILL.node; String node = claim ? Perm.CLAIM_FILL.node : Perm.UNCLAIM_FILL.node;
this.addRequirements(ReqHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -4,8 +4,8 @@ import java.util.Collections;
import java.util.Set; import java.util.Set;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
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.PS;
@ -24,9 +24,9 @@ public class CmdFactionsSetOne extends CmdFactionsSetXSimple
this.addAliases("one"); this.addAliases("one");
// Requirements // Requirements
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_ONE.node : Perm.UNCLAIM_ONE.node; String node = claim ? Perm.CLAIM_ONE.node : Perm.UNCLAIM_ONE.node;
this.addRequirements(ReqHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -5,8 +5,8 @@ import java.util.Set;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
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.PS;
@ -29,9 +29,9 @@ public class CmdFactionsSetSquare extends CmdFactionsSetXRadius
this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using square."); this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using square.");
// Requirements // Requirements
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_SQUARE.node : Perm.UNCLAIM_SQUARE.node; String node = claim ? Perm.CLAIM_SQUARE.node : Perm.UNCLAIM_SQUARE.node;
this.addRequirements(ReqHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.cmd.type.TypeFaction;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.massivecore.MassiveException; 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 public abstract class CmdFactionsSetXAll extends CmdFactionsSetX
{ {

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.type.TypeFaction; import com.massivecraft.factions.cmd.type.TypeFaction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.MassiveException; 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 public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX

View File

@ -7,8 +7,8 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.event.EventFactionsHomeChange; import com.massivecraft.factions.event.EventFactionsHomeChange;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
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.PS;
public class CmdFactionsSethome extends FactionsCommandHome public class CmdFactionsSethome extends FactionsCommandHome
@ -26,8 +26,8 @@ public class CmdFactionsSethome extends FactionsCommandHome
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.SETHOME.node)); this.addRequirements(RequirementHasPerm.get(Perm.SETHOME.node));
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsPowerChange; import com.massivecraft.factions.event.EventFactionsPowerChange;
import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason; import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeDouble; import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
public class CmdFactionsSetpower extends FactionsCommand public class CmdFactionsSetpower extends FactionsCommand
{ {
@ -25,7 +25,7 @@ public class CmdFactionsSetpower extends FactionsCommand
this.addParameter(TypeDouble.get(), "power"); this.addParameter(TypeDouble.get(), "power");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.SETPOWER.node)); this.addRequirements(RequirementHasPerm.get(Perm.SETPOWER.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -13,8 +13,8 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.Parameter; import com.massivecraft.massivecore.command.Parameter;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Pager;
import com.massivecraft.massivecore.pager.Stringifier; import com.massivecraft.massivecore.pager.Stringifier;
import com.massivecraft.massivecore.util.TimeDiffUtil; import com.massivecraft.massivecore.util.TimeDiffUtil;
@ -39,7 +39,7 @@ public class CmdFactionsStatus extends FactionsCommand
this.addParameter(TypeSortMPlayer.get(), "sort by", "time"); this.addParameter(TypeSortMPlayer.get(), "sort by", "time");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.STATUS.node)); this.addRequirements(RequirementHasPerm.get(Perm.STATUS.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -2,10 +2,10 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.Visibility; import com.massivecraft.massivecore.command.Visibility;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqTitlesAvailable; import com.massivecraft.massivecore.command.requirement.RequirementTitlesAvailable;
import com.massivecraft.massivecore.cmd.type.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.mixin.Mixin;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -21,11 +21,11 @@ public class CmdFactionsTerritorytitles extends FactionsCommand
this.addAliases("tt", "territorytitles"); this.addAliases("tt", "territorytitles");
// Parameters // Parameters
this.addParameter(TypeBoolean.get(), "on|off", "toggle"); this.addParameter(TypeBoolean.getOn(), "on|off", "toggle");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.TERRITORYTITLES.node)); this.addRequirements(RequirementHasPerm.get(Perm.TERRITORYTITLES.node));
this.addRequirements(ReqTitlesAvailable.get()); this.addRequirements(RequirementTitlesAvailable.get());
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -8,8 +8,8 @@ import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsTitleChange; import com.massivecraft.factions.event.EventFactionsTitleChange;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.type.TypeString; import com.massivecraft.massivecore.command.type.primitive.TypeString;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsTitle extends FactionsCommand public class CmdFactionsTitle extends FactionsCommand
@ -28,7 +28,7 @@ public class CmdFactionsTitle extends FactionsCommand
this.addParameter(TypeString.get(), "title", "", true); this.addParameter(TypeString.get(), "title", "", true);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.TITLE.node)); this.addRequirements(RequirementHasPerm.get(Perm.TITLE.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactionsUnclaim extends FactionsCommand public class CmdFactionsUnclaim extends FactionsCommand
@ -35,7 +35,7 @@ public class CmdFactionsUnclaim extends FactionsCommand
this.addChild(this.cmdFactionsUnclaimAll); this.addChild(this.cmdFactionsUnclaimAll);
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node)); this.addRequirements(RequirementHasPerm.get(Perm.UNCLAIM.node));
} }
} }

View File

@ -6,7 +6,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.event.EventFactionsHomeChange; import com.massivecraft.factions.event.EventFactionsHomeChange;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactionsUnsethome extends FactionsCommandHome public class CmdFactionsUnsethome extends FactionsCommandHome
{ {
@ -23,7 +23,7 @@ public class CmdFactionsUnsethome extends FactionsCommandHome
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.UNSETHOME.node)); this.addRequirements(RequirementHasPerm.get(Perm.UNSETHOME.node));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -14,8 +14,8 @@ import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.mixin.Mixin;
import com.massivecraft.massivecore.mixin.TeleporterException; import com.massivecraft.massivecore.mixin.TeleporterException;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
@ -34,8 +34,8 @@ public class CmdFactionsUnstuck extends FactionsCommand
this.addAliases("unstuck"); this.addAliases("unstuck");
// Requirements // Requirements
this.addRequirements(ReqHasPerm.get(Perm.UNSTUCK.node)); this.addRequirements(RequirementHasPerm.get(Perm.UNSTUCK.node));
this.addRequirements(ReqIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -36,7 +36,7 @@ public class CmdFactionsXPlaceholder extends FactionsCommand
{ {
msg("<b>The extension <h>%s <b>isn't installed.", this.extensionName); msg("<b>The extension <h>%s <b>isn't installed.", this.extensionName);
msg("<g>Learn more and download the extension here:"); msg("<g>Learn more and download the extension here:");
msg("<aqua>http://www.massivecraft.com/%s", this.extensionName.toLowerCase()); msg("<aqua>https://www.massivecraft.com/%s", this.extensionName.toLowerCase());
} }
} }

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.massivecore.cmd.MassiveCommand; import com.massivecraft.massivecore.command.MassiveCommand;
public class FactionsCommand extends MassiveCommand public class FactionsCommand extends MassiveCommand
{ {

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.req.ReqFactionHomesEnabled; import com.massivecraft.factions.cmd.req.ReqFactionHomesEnabled;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.cmd.Visibility; import com.massivecraft.massivecore.command.Visibility;
public class FactionsCommandHome extends FactionsCommand public class FactionsCommandHome extends FactionsCommand
{ {

View File

@ -4,11 +4,11 @@ import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.massivecore.cmd.MassiveCommand; import com.massivecraft.massivecore.command.MassiveCommand;
import com.massivecraft.massivecore.cmd.req.ReqAbstract; import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class ReqBankCommandsEnabled extends ReqAbstract public class ReqBankCommandsEnabled extends RequirementAbstract
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -3,11 +3,11 @@ package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.cmd.MassiveCommand; import com.massivecraft.massivecore.command.MassiveCommand;
import com.massivecraft.massivecore.cmd.req.ReqAbstract; import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class ReqFactionHomesEnabled extends ReqAbstract public class ReqFactionHomesEnabled extends RequirementAbstract
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -3,12 +3,12 @@ package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.cmd.MassiveCommand; import com.massivecraft.massivecore.command.MassiveCommand;
import com.massivecraft.massivecore.cmd.req.ReqAbstract; import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class ReqHasFaction extends ReqAbstract public class ReqHasFaction extends RequirementAbstract
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -3,12 +3,12 @@ package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.cmd.MassiveCommand; import com.massivecraft.massivecore.command.MassiveCommand;
import com.massivecraft.massivecore.cmd.req.ReqAbstract; import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class ReqHasntFaction extends ReqAbstract public class ReqHasntFaction extends RequirementAbstract
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -4,12 +4,12 @@ import org.bukkit.command.CommandSender;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.cmd.MassiveCommand; import com.massivecraft.massivecore.command.MassiveCommand;
import com.massivecraft.massivecore.cmd.req.ReqAbstract; import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class ReqRoleIsAtLeast extends ReqAbstract public class ReqRoleIsAtLeast extends RequirementAbstract
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.MPlayerColl;
import com.massivecraft.massivecore.CaseInsensitiveComparator; import com.massivecraft.massivecore.CaseInsensitiveComparator;
import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveCore;
import com.massivecraft.massivecore.MassiveException; 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; import com.massivecraft.massivecore.util.IdUtil;
public class TypeFaction extends TypeAbstract<Faction> public class TypeFaction extends TypeAbstract<Faction>
@ -30,6 +30,18 @@ public class TypeFaction extends TypeAbstract<Faction>
// OVERRIDE // 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 @Override
public Faction read(String str, CommandSender sender) throws MassiveException public Faction read(String str, CommandSender sender) throws MassiveException
{ {

View File

@ -1,17 +1,12 @@
package com.massivecraft.factions.cmd.type; package com.massivecraft.factions.cmd.type;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MFlag;
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; import com.massivecraft.factions.entity.MFlagColl;
import com.massivecraft.massivecore.cmd.type.TypeAllAble; import com.massivecraft.massivecore.command.type.store.TypeEntity;
import com.massivecraft.massivecore.util.Txt;
public class TypeMFlag extends TypeAbstractSelect<MFlag> implements TypeAllAble<MFlag> public class TypeMFlag extends TypeEntity<MFlag>
{ {
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
@ -19,6 +14,10 @@ public class TypeMFlag extends TypeAbstractSelect<MFlag> implements TypeAllAble<
private static TypeMFlag i = new TypeMFlag(); private static TypeMFlag i = new TypeMFlag();
public static TypeMFlag get() { return i; } public static TypeMFlag get() { return i; }
public TypeMFlag()
{
super(MFlagColl.get());
}
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE // OVERRIDE
@ -31,71 +30,9 @@ public class TypeMFlag extends TypeAbstractSelect<MFlag> implements TypeAllAble<
} }
@Override @Override
public MFlag select(String arg, CommandSender sender) public Collection<MFlag> getAll()
{
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<String> altNames(CommandSender sender)
{
List<String> ret = new ArrayList<String>();
for (MFlag mflag : MFlag.getAll())
{
ret.add(Txt.upperCaseFirst(mflag.getName()));
}
return ret;
}
@Override
public Collection<String> getTabList(CommandSender sender, String arg)
{
return this.altNames(sender);
}
@Override
public Collection<MFlag> getAll(CommandSender sender)
{ {
return MFlag.getAll(); return MFlag.getAll();
} }
// -------------------------------------------- //
// UTIL
// -------------------------------------------- //
public static String getComparable(String string)
{
return string.toLowerCase();
}
public static String getComparable(MFlag mflag)
{
return getComparable(mflag.getName());
}
} }

View File

@ -1,17 +1,12 @@
package com.massivecraft.factions.cmd.type; package com.massivecraft.factions.cmd.type;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm;
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; import com.massivecraft.factions.entity.MPermColl;
import com.massivecraft.massivecore.cmd.type.TypeAllAble; import com.massivecraft.massivecore.command.type.store.TypeEntity;
import com.massivecraft.massivecore.util.Txt;
public class TypeMPerm extends TypeAbstractSelect<MPerm> implements TypeAllAble<MPerm> public class TypeMPerm extends TypeEntity<MPerm>
{ {
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
@ -19,6 +14,10 @@ public class TypeMPerm extends TypeAbstractSelect<MPerm> implements TypeAllAble<
private static TypeMPerm i = new TypeMPerm(); private static TypeMPerm i = new TypeMPerm();
public static TypeMPerm get() { return i; } public static TypeMPerm get() { return i; }
public TypeMPerm()
{
super(MPermColl.get());
}
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE // OVERRIDE
@ -31,71 +30,10 @@ public class TypeMPerm extends TypeAbstractSelect<MPerm> implements TypeAllAble<
} }
@Override @Override
public MPerm select(String arg, CommandSender sender) public Collection<MPerm> getAll()
{
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<String> altNames(CommandSender sender)
{
List<String> ret = new ArrayList<String>();
for (MPerm mperm : MPerm.getAll())
{
ret.add(Txt.upperCaseFirst(mperm.getName()));
}
return ret;
}
@Override
public Collection<String> getTabList(CommandSender sender, String arg)
{
return this.altNames(sender);
}
@Override
public Collection<MPerm> getAll(CommandSender sender)
{ {
return MPerm.getAll(); return MPerm.getAll();
} }
// -------------------------------------------- //
// UTIL
// -------------------------------------------- //
public static String getComparable(String string)
{
return string.toLowerCase();
}
public static String getComparable(MPerm mperm)
{
return getComparable(mperm.getName());
}
} }

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.type;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.MPlayerColl; import com.massivecraft.factions.entity.MPlayerColl;
import com.massivecraft.massivecore.cmd.type.Type; import com.massivecraft.massivecore.command.type.Type;
public class TypeMPlayer public class TypeMPlayer
{ {

View File

@ -1,55 +1,52 @@
package com.massivecraft.factions.cmd.type; package com.massivecraft.factions.cmd.type;
import java.util.Collection; import java.util.Set;
import java.util.Collections;
import java.util.List;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.collections.MassiveSet;
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; import com.massivecraft.massivecore.command.type.enumeration.TypeEnum;
import com.massivecraft.massivecore.util.MUtil;
import com.massivecraft.massivecore.util.Txt;
public class TypeRank extends TypeAbstractSelect<Rel> public class TypeRank extends TypeEnum<Rel>
{ {
// -------------------------------------------- // // -------------------------------------------- //
// CONSTANTS // CONSTANTS
// -------------------------------------------- // // -------------------------------------------- //
public static final List<String> ALT_NAMES = Collections.unmodifiableList(MUtil.list( public static final Set<String> NAMES_PROMOTE = new MassiveSet<String>(
Txt.getNicedEnum(Rel.LEADER),
Txt.getNicedEnum(Rel.OFFICER),
Txt.getNicedEnum(Rel.MEMBER),
Txt.getNicedEnum(Rel.RECRUIT),
"Promote", "Promote",
"Demote" "+",
)); "Plus",
"Up"
);
public static final Set<String> NAMES_DEMOTE = new MassiveSet<String>(
"Demote",
"-",
"Minus",
"Down"
);
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
// -------------------------------------------- // // -------------------------------------------- //
// Default constructor. Can't use promote and demote. // Can be used to 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.
public static TypeRank get(Rel rank) { return new TypeRank(rank); } public static TypeRank get(Rel rank) { return new TypeRank(rank); }
public TypeRank(Rel rank) public TypeRank(Rel rank)
{ {
if (rank == null) throw new IllegalArgumentException("Do not use null, the default constructor can be used however."); super(Rel.class);
if ( ! rank.isRank()) throw new IllegalArgumentException(rank + " is not a valid rank"); if (rank != null && ! rank.isRank()) throw new IllegalArgumentException(rank + " is not a valid rank");
this.startRank = 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 // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
@ -63,106 +60,48 @@ public class TypeRank extends TypeAbstractSelect<Rel>
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public Rel select(String arg, CommandSender sender) throws MassiveException public String getTypeName()
{ {
// This is especially useful when one rank can have aliases. return "rank";
// 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("<b>You can't use promote & demote.");
}
// Promote
if (arg.equals("promote"))
{
if (Rel.LEADER.equals(startRank)) throw new MassiveException().addMsg("<b>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("<b>You can't demote a recruit.");
}
return null;
} }
@Override @Override
public Collection<String> altNames(CommandSender sender) public Set<String> getNamesInner(Rel value)
{ {
return ALT_NAMES; // Create
Set<String> ret = super.getNamesInner(value);
// Fill Exact
if (value == Rel.LEADER)
{
ret.add("admin");
}
else if (value == Rel.OFFICER)
{
ret.add("moderator");
}
else if (value == Rel.MEMBER)
{
ret.add("member");
ret.add("normal");
} }
// Fill Relative
@Override Rel start = this.getStartRank();
public Collection<String> getTabList(CommandSender sender, String arg) if (start != null)
{ {
return this.altNames(sender); if (value == Rel.LEADER && start == Rel.OFFICER) ret.addAll(NAMES_PROMOTE);
}
if (value == Rel.OFFICER && start == Rel.MEMBER) ret.addAll(NAMES_PROMOTE);
@Override if (value == Rel.OFFICER && start == Rel.LEADER) ret.addAll(NAMES_DEMOTE);
public boolean isValid(String arg, CommandSender sender)
{ if (value == Rel.MEMBER && start == Rel.RECRUIT) ret.addAll(NAMES_PROMOTE);
try if (value == Rel.MEMBER && start == Rel.OFFICER) ret.addAll(NAMES_DEMOTE);
{
return this.select(arg, sender) != null; if (value == Rel.RECRUIT && start == Rel.MEMBER) ret.addAll(NAMES_DEMOTE);
}
catch (MassiveException e)
{
return true;
}
}
// -------------------------------------------- //
// ARG
// -------------------------------------------- //
public static String getComparable(String str)
{
String ret = str.toLowerCase();
if (ret.startsWith("admin") || ret.startsWith("lea"))
{
ret = "leader";
}
else if (ret.startsWith("mod") || ret.startsWith("off"))
{
ret = "officer";
}
else if (ret.startsWith("mem") || ret.startsWith("nor"))
{
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";
} }
// Return
return ret; return ret;
} }

View File

@ -1,16 +1,11 @@
package com.massivecraft.factions.cmd.type; package com.massivecraft.factions.cmd.type;
import java.util.ArrayList; import java.util.Set;
import java.util.Collection;
import java.util.List;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; import com.massivecraft.massivecore.command.type.enumeration.TypeEnum;
import com.massivecraft.massivecore.util.Txt;
public class TypeRel extends TypeAbstractSelect<Rel> public class TypeRel extends TypeEnum<Rel>
{ {
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
@ -18,6 +13,7 @@ public class TypeRel extends TypeAbstractSelect<Rel>
private static TypeRel i = new TypeRel(); private static TypeRel i = new TypeRel();
public static TypeRel get() { return i; } public static TypeRel get() { return i; }
public TypeRel() { super(Rel.class); }
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE // OVERRIDE
@ -30,28 +26,24 @@ public class TypeRel extends TypeAbstractSelect<Rel>
} }
@Override @Override
public Rel select(String str, CommandSender sender) public Set<String> getNamesInner(Rel value)
{ {
return Rel.parse(str); Set<String> ret = super.getNamesInner(value);
if (value == Rel.LEADER)
{
ret.add("admin");
} }
else if (value == Rel.OFFICER)
@Override
public Collection<String> altNames(CommandSender sender)
{ {
List<String> ret = new ArrayList<String>(); ret.add("moderator");
}
for (Rel rel : Rel.values()) else if (value == Rel.MEMBER)
{ {
ret.add(Txt.getNicedEnum(rel)); ret.add("normal");
} }
return ret; return ret;
} }
@Override
public Collection<String> getTabList(CommandSender sender, String arg)
{
return this.altNames(sender);
}
} }

View File

@ -1,27 +1,17 @@
package com.massivecraft.factions.cmd.type; package com.massivecraft.factions.cmd.type;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.PlayerInactivityComparator; import com.massivecraft.factions.PlayerInactivityComparator;
import com.massivecraft.factions.PlayerPowerComparator; import com.massivecraft.factions.PlayerPowerComparator;
import com.massivecraft.factions.PlayerRoleComparator; import com.massivecraft.factions.PlayerRoleComparator;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect; import com.massivecraft.massivecore.collections.MassiveList;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.command.type.TypeAbstractChoice;
public class TypeSortMPlayer extends TypeAbstractSelect<Comparator<MPlayer>> public class TypeSortMPlayer extends TypeAbstractChoice<Comparator<MPlayer>>
{ {
// -------------------------------------------- //
// CONSTANTS
// -------------------------------------------- //
public static final List<String> ALT_NAMES = Collections.unmodifiableList(MUtil.list("rank", "power", "time"));
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
// -------------------------------------------- // // -------------------------------------------- //
@ -39,40 +29,17 @@ public class TypeSortMPlayer extends TypeAbstractSelect<Comparator<MPlayer>>
return "player sorter"; return "player sorter";
} }
@SuppressWarnings("unchecked")
@Override @Override
public Comparator<MPlayer> select(String sortedBy, CommandSender sender) public Collection<Comparator<MPlayer>> getAll()
{ {
sortedBy = sortedBy.toLowerCase(); return new MassiveList<Comparator<MPlayer>>(
PlayerRoleComparator.get(),
if (sortedBy.startsWith("r")) PlayerPowerComparator.get(),
{ PlayerInactivityComparator.get()
// 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;
}
@Override
public Collection<String> altNames(CommandSender sender)
{
return ALT_NAMES;
}
@Override
public Collection<String> getTabList(CommandSender sender, String arg)
{
return this.altNames(sender);
}
} }

View File

@ -15,6 +15,7 @@ import com.massivecraft.factions.Rel;
import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.RelationParticipator;
import com.massivecraft.factions.util.*; import com.massivecraft.factions.util.*;
import com.massivecraft.massivecore.CaseInsensitiveComparator; import com.massivecraft.massivecore.CaseInsensitiveComparator;
import com.massivecraft.massivecore.Named;
import com.massivecraft.massivecore.collections.MassiveMapDef; import com.massivecraft.massivecore.collections.MassiveMapDef;
import com.massivecraft.massivecore.collections.MassiveTreeSetDef; import com.massivecraft.massivecore.collections.MassiveTreeSetDef;
import com.massivecraft.massivecore.mixin.Mixin; 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.MUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class Faction extends Entity<Faction> implements EconomyParticipator public class Faction extends Entity<Faction> implements EconomyParticipator, Named
{ {
// -------------------------------------------- // // -------------------------------------------- //
// META // META
@ -154,6 +155,7 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
// RAW // RAW
@Override
public String getName() public String getName()
{ {
String ret = this.name; String ret = this.name;

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.entity;
import java.util.List; import java.util.List;
import com.massivecraft.factions.event.EventFactionsCreateFlags; import com.massivecraft.factions.event.EventFactionsCreateFlags;
import com.massivecraft.massivecore.Named;
import com.massivecraft.massivecore.PredicateIsRegistered; import com.massivecraft.massivecore.PredicateIsRegistered;
import com.massivecraft.massivecore.Prioritized; import com.massivecraft.massivecore.Prioritized;
import com.massivecraft.massivecore.PriorityComparator; 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.store.Entity;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class MFlag extends Entity<MFlag> implements Prioritized, Registerable public class MFlag extends Entity<MFlag> implements Prioritized, Registerable, Named
{ {
// -------------------------------------------- // // -------------------------------------------- //
// CONSTANTS // CONSTANTS
@ -158,7 +159,7 @@ public class MFlag extends Entity<MFlag> implements Prioritized, Registerable
// I just added the name in case anyone feel like renaming their flags for some reason. // I just added the name in case anyone feel like renaming their flags for some reason.
// Example: "monsters" // Example: "monsters"
private String name = "defaultName"; 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; } public MFlag setName(String name) { this.name = name; this.changed(); return this; }
// The flag function described as a question. // The flag function described as a question.

View File

@ -12,6 +12,7 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.TerritoryAccess;
import com.massivecraft.factions.event.EventFactionsCreatePerms; import com.massivecraft.factions.event.EventFactionsCreatePerms;
import com.massivecraft.massivecore.Named;
import com.massivecraft.massivecore.PredicateIsRegistered; import com.massivecraft.massivecore.PredicateIsRegistered;
import com.massivecraft.massivecore.Prioritized; import com.massivecraft.massivecore.Prioritized;
import com.massivecraft.massivecore.PriorityComparator; 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.MUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class MPerm extends Entity<MPerm> implements Prioritized, Registerable public class MPerm extends Entity<MPerm> implements Prioritized, Registerable, Named
{ {
// -------------------------------------------- // // -------------------------------------------- //
// CONSTANTS // CONSTANTS
@ -216,7 +217,7 @@ public class MPerm extends Entity<MPerm> implements Prioritized, Registerable
// I just added the name in case anyone feel like renaming their perms for some reason. // I just added the name in case anyone feel like renaming their perms for some reason.
// Example: "build" // Example: "build"
private String name = "defaultName"; 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; } public MPerm setName(String name) { this.name = name; this.changed(); return this; }
// The perm function described as an "order". // The perm function described as an "order".