mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-26 04:05:56 +01:00
MassiveCore - More type. More editor.
This commit is contained in:
parent
53db58f582
commit
482b75be70
@ -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>
|
||||
<b>http://massivecraft.com/factions</b></a>
|
||||
<b>https://www.massivecraft.com/factions</b></a>
|
||||
|
@ -1,9 +1,9 @@
|
||||
main: com.massivecraft.factions.Factions
|
||||
name: Factions
|
||||
version: 2.8.2
|
||||
website: http://massivecraft.com/factions
|
||||
authors: [Cayorion, Brettflan]
|
||||
description: §eFactions allows the players to team up and claim land as their own and start wars with other factions. This way we hope to inspire politics, intrigue, and team spirit. §aCayorion §efrom the minecraft server §aMassiveCraft §eis the lead Factions programmer. Feel free to visit us at §bhttp://massivecraft.com
|
||||
website: https://www.massivecraft.com/factions
|
||||
authors: [Cayorion, Madus, Ulumulu1510, MarkehMe, Brettflan]
|
||||
description: §eFactions allows the players to team up and claim land as their own and start wars with other factions. This way we hope to inspire politics, intrigue, and team spirit. §aCayorion §efrom the minecraft server §aMassiveCraft §eis the lead Factions programmer. Feel free to visit us at §bhttps://www.massivecraft.com
|
||||
depend: [MassiveCore]
|
||||
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag]
|
||||
permissions:
|
||||
|
@ -3,8 +3,9 @@ package com.massivecraft.factions;
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.Named;
|
||||
|
||||
public class PlayerInactivityComparator implements Comparator<MPlayer>
|
||||
public class PlayerInactivityComparator implements Comparator<MPlayer>, Named
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
@ -13,6 +14,16 @@ public class PlayerInactivityComparator implements Comparator<MPlayer>
|
||||
private static PlayerInactivityComparator i = new PlayerInactivityComparator();
|
||||
public static PlayerInactivityComparator get() { return i; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE: NAMED
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "Time";
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE: COMPARATOR
|
||||
// -------------------------------------------- //
|
||||
|
@ -3,8 +3,9 @@ package com.massivecraft.factions;
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.Named;
|
||||
|
||||
public class PlayerPowerComparator implements Comparator<MPlayer>
|
||||
public class PlayerPowerComparator implements Comparator<MPlayer>, Named
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
@ -13,6 +14,16 @@ public class PlayerPowerComparator implements Comparator<MPlayer>
|
||||
private static PlayerPowerComparator i = new PlayerPowerComparator();
|
||||
public static PlayerPowerComparator get() { return i; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE: NAMED
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "Power";
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE: COMPARATOR
|
||||
// -------------------------------------------- //
|
||||
|
@ -3,8 +3,9 @@ package com.massivecraft.factions;
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.Named;
|
||||
|
||||
public class PlayerRoleComparator implements Comparator<MPlayer>
|
||||
public class PlayerRoleComparator implements Comparator<MPlayer>, Named
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
@ -13,6 +14,16 @@ public class PlayerRoleComparator implements Comparator<MPlayer>
|
||||
private static PlayerRoleComparator i = new PlayerRoleComparator();
|
||||
public static PlayerRoleComparator get() { return i; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE: NAMED
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "Rank";
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE: COMPARATOR
|
||||
// -------------------------------------------- //
|
||||
@ -31,4 +42,6 @@ public class PlayerRoleComparator implements Comparator<MPlayer>
|
||||
return r2.getValue() - r1.getValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -65,37 +65,6 @@ public enum Rel
|
||||
// UTIL
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static Rel parse(String str)
|
||||
{
|
||||
if (str == null || str.length() < 1) return null;
|
||||
|
||||
str = str.toLowerCase();
|
||||
|
||||
// These are to allow conversion from the old system.
|
||||
if (str.equals("admin"))
|
||||
{
|
||||
return LEADER;
|
||||
}
|
||||
|
||||
if (str.equals("moderator"))
|
||||
{
|
||||
return OFFICER;
|
||||
}
|
||||
|
||||
if (str.equals("normal"))
|
||||
{
|
||||
return MEMBER;
|
||||
}
|
||||
|
||||
// NOTE: This assumes the first char is different for all.
|
||||
for (Rel rel : values())
|
||||
{
|
||||
String relStr = rel.toString().toLowerCase();
|
||||
if (relStr.startsWith(str)) return rel;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isAtLeast(Rel rel)
|
||||
{
|
||||
return this.value >= rel.value;
|
||||
|
@ -3,6 +3,8 @@ package com.massivecraft.factions.adapter;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.cmd.type.TypeRel;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.xlib.gson.JsonDeserializationContext;
|
||||
import com.massivecraft.massivecore.xlib.gson.JsonDeserializer;
|
||||
import com.massivecraft.massivecore.xlib.gson.JsonElement;
|
||||
@ -24,7 +26,14 @@ public class RelAdapter implements JsonDeserializer<Rel>
|
||||
@Override
|
||||
public Rel deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
|
||||
{
|
||||
return Rel.parse(json.getAsString());
|
||||
try
|
||||
{
|
||||
return TypeRel.get().read(json.getAsString());
|
||||
}
|
||||
catch (MassiveException e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import java.util.List;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.cmd.DeprecatedCommand;
|
||||
import com.massivecraft.massivecore.cmd.VersionCommand;
|
||||
import com.massivecraft.massivecore.command.DeprecatedCommand;
|
||||
import com.massivecraft.massivecore.command.VersionCommand;
|
||||
|
||||
public class CmdFactions extends FactionsCommand
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
|
||||
|
||||
public class CmdFactionsAccess extends FactionsCommand
|
||||
@ -30,8 +30,8 @@ public class CmdFactionsAccess extends FactionsCommand
|
||||
this.addAliases("access");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.ACCESS.node));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS.node));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import com.massivecraft.factions.TerritoryAccess;
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
@ -32,7 +32,7 @@ public abstract class CmdFactionsAccessAbstract extends FactionsCommand
|
||||
public CmdFactionsAccessAbstract()
|
||||
{
|
||||
// Requirements
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeBoolean;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
|
||||
|
||||
public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract
|
||||
{
|
||||
@ -22,10 +22,10 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction");
|
||||
this.addParameter(TypeBoolean.get(), "yes/no", "toggle");
|
||||
this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_FACTION.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_FACTION.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeBoolean;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
|
||||
|
||||
public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract
|
||||
{
|
||||
@ -22,10 +22,10 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeMPlayer.get(), "player");
|
||||
this.addParameter(TypeBoolean.get(), "yes/no", "toggle");
|
||||
this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_PLAYER.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_PLAYER.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactionsAccessView extends CmdFactionsAccessAbstract
|
||||
{
|
||||
@ -15,7 +15,7 @@ public class CmdFactionsAccessView extends CmdFactionsAccessAbstract
|
||||
this.addAliases("view");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_VIEW.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_VIEW.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -3,8 +3,8 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeBoolean;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
|
||||
import com.massivecraft.massivecore.util.IdUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -20,10 +20,10 @@ public class CmdFactionsAdmin extends FactionsCommand
|
||||
this.addAliases("admin");
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeBoolean.get(), "on/off", "flip");
|
||||
this.addParameter(TypeBoolean.getOn(), "on/off", "flip");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.ADMIN.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ADMIN.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
|
||||
public class CmdFactionsClaim extends FactionsCommand
|
||||
@ -35,7 +35,7 @@ public class CmdFactionsClaim extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsClaimAll);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.CLAIM.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.CLAIM.node));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ import com.massivecraft.factions.event.EventFactionsCreate;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeString;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||
import com.massivecraft.massivecore.mson.Mson;
|
||||
import com.massivecraft.massivecore.store.MStore;
|
||||
|
||||
@ -36,7 +36,7 @@ public class CmdFactionsCreate extends FactionsCommand
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasntFaction.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.CREATE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.CREATE.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.event.EventFactionsDescriptionChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeString;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||
import com.massivecraft.massivecore.mixin.Mixin;
|
||||
|
||||
public class CmdFactionsDescription extends FactionsCommand
|
||||
@ -25,7 +25,7 @@ public class CmdFactionsDescription extends FactionsCommand
|
||||
this.addParameter(TypeString.get(), "desc", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.DESCRIPTION.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipC
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.util.IdUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -32,7 +32,7 @@ public class CmdFactionsDisband extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.DISBAND.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.DISBAND.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -4,7 +4,7 @@ import java.util.Map.Entry;
|
||||
|
||||
import com.massivecraft.factions.event.EventFactionsExpansions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsExpansions extends FactionsCommand
|
||||
@ -19,7 +19,7 @@ public class CmdFactionsExpansions extends FactionsCommand
|
||||
this.addAliases("expansions");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.EXPANSIONS.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.EXPANSIONS.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
@ -47,7 +47,7 @@ public class CmdFactionsExpansions extends FactionsCommand
|
||||
|
||||
// URL Suggestion
|
||||
msg("<i>Learn all about expansions in the online documentation:");
|
||||
msg("<aqua>http://www.massivecraft.com/factions");
|
||||
msg("<aqua>https://www.massivecraft.com/factions");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.PriorityLines;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.mixin.Mixin;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -31,7 +31,7 @@ public class CmdFactionsFaction extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.FACTION.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FACTION.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactionsFlag extends FactionsCommand
|
||||
{
|
||||
@ -28,7 +28,7 @@ public class CmdFactionsFlag extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsFlagSet);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.FLAG.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG.node));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ import java.util.List;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.Parameter;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.Parameter;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsFlagList extends FactionsCommand
|
||||
@ -25,7 +25,7 @@ public class CmdFactionsFlagList extends FactionsCommand
|
||||
this.addParameter(Parameter.getPage());
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.FLAG_LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_LIST.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -8,8 +8,8 @@ import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.event.EventFactionsFlagChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeBoolean;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
|
||||
|
||||
public class CmdFactionsFlagSet extends FactionsCommand
|
||||
{
|
||||
@ -24,11 +24,11 @@ public class CmdFactionsFlagSet extends FactionsCommand
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeMFlag.get(), "flag");
|
||||
this.addParameter(TypeBoolean.get(), "yes/no");
|
||||
this.addParameter(TypeBoolean.getYes(), "yes/no");
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.FLAG_SET.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SET.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -10,9 +10,8 @@ import com.massivecraft.factions.cmd.type.TypeMFlag;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAll;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeSet;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.collection.TypeSet;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsFlagShow extends FactionsCommand
|
||||
@ -28,10 +27,10 @@ public class CmdFactionsFlagShow extends FactionsCommand
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
this.addParameter(TypeAll.get(TypeSet.get(TypeMFlag.get(), false)), "flags", "all", true);
|
||||
this.addParameter(TypeSet.get(TypeMFlag.get()), "flags", "all", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.FLAG_SHOW.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SHOW.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -16,8 +16,8 @@ import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.event.EventFactionsHomeTeleport;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.mixin.Mixin;
|
||||
import com.massivecraft.massivecore.mixin.TeleporterException;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
@ -41,8 +41,8 @@ public class CmdFactionsHome extends FactionsCommandHome
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.HOME.node));
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.HOME.node));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactionsInvite extends FactionsCommand
|
||||
{
|
||||
@ -29,7 +29,7 @@ public class CmdFactionsInvite extends FactionsCommand
|
||||
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.INVITE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE.node));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,8 +11,8 @@ import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.event.EventFactionsInvitedChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeSet;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.collection.TypeSet;
|
||||
import com.massivecraft.massivecore.mson.Mson;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -27,10 +27,10 @@ public class CmdFactionsInviteAdd extends FactionsCommand
|
||||
this.addAliases("add");
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeSet.get(TypeMPlayer.get(), true), "players", true);
|
||||
this.addParameter(TypeSet.get(TypeMPlayer.get()), "players", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.INVITE_ADD.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_ADD.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.Parameter;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.Parameter;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.pager.Pager;
|
||||
import com.massivecraft.massivecore.pager.Stringifier;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
@ -31,7 +31,7 @@ public class CmdFactionsInviteList extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.INVITE_LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_LIST.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -14,8 +14,8 @@ import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.event.EventFactionsInvitedChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeSet;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.collection.TypeSet;
|
||||
import com.massivecraft.massivecore.mson.Mson;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -30,10 +30,10 @@ public class CmdFactionsInviteRemove extends FactionsCommand
|
||||
this.addAliases("remove");
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeSet.get(TypeMPlayer.get(), true), "players/all", true);
|
||||
this.addParameter(TypeSet.get(TypeMPlayer.get()), "players/all", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.INVITE_REMOVE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_REMOVE.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -13,7 +13,7 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.mson.Mson;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -33,7 +33,7 @@ public class CmdFactionsJoin extends FactionsCommand
|
||||
this.addParameter(TypeMPlayer.get(), "player", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.JOIN.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.JOIN.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.mson.Mson;
|
||||
import com.massivecraft.massivecore.util.IdUtil;
|
||||
|
||||
@ -33,7 +33,7 @@ public class CmdFactionsKick extends FactionsCommand
|
||||
this.addParameter(TypeMPlayer.get(), "player");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.KICK.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.KICK.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactionsLeave extends FactionsCommand
|
||||
{
|
||||
@ -16,7 +16,7 @@ public class CmdFactionsLeave extends FactionsCommand
|
||||
this.addAliases("leave");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.LEAVE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.LEAVE.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,8 @@ import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.FactionColl;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.Parameter;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.Parameter;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.pager.Pager;
|
||||
import com.massivecraft.massivecore.pager.Stringifier;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
@ -31,7 +31,7 @@ public class CmdFactionsList extends FactionsCommand
|
||||
this.addParameter(Parameter.getPage());
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.LIST.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -8,9 +8,9 @@ import com.massivecraft.factions.Const;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeBoolean;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
|
||||
public class CmdFactionsMap extends FactionsCommand
|
||||
@ -25,11 +25,11 @@ public class CmdFactionsMap extends FactionsCommand
|
||||
this.addAliases("map");
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeBoolean.get(), "on/off", "once");
|
||||
this.addParameter(TypeBoolean.getOn(), "on/off", "once");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MAP.node));
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MAP.node));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactionsMoney extends FactionsCommand
|
||||
{
|
||||
@ -36,7 +36,7 @@ public class CmdFactionsMoney extends FactionsCommand
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MONEY.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY.node));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactionsMoneyBalance extends FactionsCommand
|
||||
{
|
||||
@ -23,7 +23,7 @@ public class CmdFactionsMoneyBalance extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MONEY_BALANCE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_BALANCE.node));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeDouble;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||
import com.massivecraft.massivecore.money.Money;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -31,7 +31,7 @@ public class CmdFactionsMoneyDeposit extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MONEY_DEPOSIT.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_DEPOSIT.node));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeDouble;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||
import com.massivecraft.massivecore.money.Money;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -33,7 +33,7 @@ public class CmdFactionsMoneyTransferFf extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2F.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2F.node));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeDouble;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||
import com.massivecraft.massivecore.money.Money;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferFp extends FactionsCommand
|
||||
this.addParameter(TypeMPlayer.get(), "player");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2P.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2P.node));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeDouble;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||
import com.massivecraft.massivecore.money.Money;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferPf extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MONEY_P2F.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_P2F.node));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeDouble;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||
import com.massivecraft.massivecore.money.Money;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -33,7 +33,7 @@ public class CmdFactionsMoneyWithdraw extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MONEY_WITHDRAW.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_WITHDRAW.node));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.event.EventFactionsMotdChange;
|
||||
import com.massivecraft.massivecore.MassiveCore;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeString;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||
import com.massivecraft.massivecore.mixin.Mixin;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
@ -27,7 +27,7 @@ public class CmdFactionsMotd extends FactionsCommand
|
||||
this.addParameter(TypeString.get(), "new", "read", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.MOTD.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MOTD.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.event.EventFactionsNameChange;
|
||||
import com.massivecraft.factions.util.MiscUtil;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeString;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||
|
||||
public class CmdFactionsName extends FactionsCommand
|
||||
{
|
||||
@ -29,7 +29,7 @@ public class CmdFactionsName extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.NAME.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.NAME.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactionsPerm extends FactionsCommand
|
||||
{
|
||||
@ -28,7 +28,7 @@ public class CmdFactionsPerm extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsPermSet);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.PERM.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM.node));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ import java.util.List;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.Parameter;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.Parameter;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsPermList extends FactionsCommand
|
||||
@ -25,7 +25,7 @@ public class CmdFactionsPermList extends FactionsCommand
|
||||
this.addParameter(Parameter.getPage());
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.PERM_LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_LIST.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -12,8 +12,8 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeBoolean;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsPermSet extends FactionsCommand
|
||||
@ -30,11 +30,11 @@ public class CmdFactionsPermSet extends FactionsCommand
|
||||
// Parameters
|
||||
this.addParameter(TypeMPerm.get(), "perm");
|
||||
this.addParameter(TypeRel.get(), "relation");
|
||||
this.addParameter(TypeBoolean.get(), "yes/no");
|
||||
this.addParameter(TypeBoolean.getYes(), "yes/no");
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.PERM_SET.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_SET.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -10,9 +10,8 @@ import com.massivecraft.factions.cmd.type.TypeMPerm;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAll;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeSet;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.collection.TypeSet;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsPermShow extends FactionsCommand
|
||||
@ -28,10 +27,10 @@ public class CmdFactionsPermShow extends FactionsCommand
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
this.addParameter(TypeAll.get(TypeSet.get(TypeMPerm.get(), false)), "perms", "all", true);
|
||||
this.addParameter(TypeSet.get(TypeMPerm.get()), "perms", "all", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.PERM_SHOW.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_SHOW.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -10,7 +10,7 @@ import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.event.EventFactionsRemovePlayerMillis;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.Progressbar;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.util.TimeDiffUtil;
|
||||
import com.massivecraft.massivecore.util.TimeUnit;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
@ -30,7 +30,7 @@ public class CmdFactionsPlayer extends FactionsCommand
|
||||
this.addParameter(TypeMPlayer.get(), "player", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PLAYER.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -7,10 +7,10 @@ import com.massivecraft.factions.cmd.type.TypeMPlayer;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.Parameter;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeDouble;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeString;
|
||||
import com.massivecraft.massivecore.command.Parameter;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||
|
||||
public class CmdFactionsPowerBoost extends FactionsCommand
|
||||
{
|
||||
@ -36,7 +36,7 @@ public class CmdFactionsPowerBoost extends FactionsCommand
|
||||
this.addParameter(TypeDouble.get(), "#");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.POWERBOOST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.POWERBOOST.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -18,7 +18,7 @@ import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||
import com.massivecraft.factions.event.EventFactionsRankChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsRank extends FactionsCommand
|
||||
@ -66,7 +66,7 @@ public class CmdFactionsRank extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "their");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.RANK.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RANK.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.cmd.type.TypeMPlayer;
|
||||
import com.massivecraft.massivecore.cmd.Visibility;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
|
||||
public class CmdFactionsRankOld extends FactionsCommand
|
||||
|
@ -10,8 +10,8 @@ import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.event.EventFactionsRelationChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.mson.Mson;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -29,7 +29,7 @@ public abstract class CmdFactionsRelationAbstract extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.RELATION.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,9 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeBoolean;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsSeeChunk extends FactionsCommand
|
||||
@ -19,11 +19,11 @@ public class CmdFactionsSeeChunk extends FactionsCommand
|
||||
this.addAliases("sc", "seechunk");
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeBoolean.get(), "active", "toggle");
|
||||
this.addParameter(TypeBoolean.getOn(), "active", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.SEECHUNK.node));
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNK.node));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -7,8 +7,8 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.util.VisualizeUtil;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
|
||||
|
||||
@ -24,8 +24,8 @@ public class CmdFactionsSeeChunkOld extends FactionsCommand
|
||||
this.addAliases("sco", "seechunkold");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.SEECHUNKOLD.node));
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNKOLD.node));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -9,7 +9,7 @@ import com.massivecraft.factions.entity.Board;
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.mixin.Mixin;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
@ -38,7 +38,7 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll
|
||||
|
||||
// Requirements
|
||||
String node = claim ? Perm.CLAIM_ALL.node : Perm.UNCLAIM_ALL.node;
|
||||
this.addRequirements(ReqHasPerm.get(node));
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.FactionColl;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
|
||||
|
||||
@ -43,9 +43,9 @@ public class CmdFactionsSetAuto extends FactionsCommand
|
||||
}
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_AUTO.node : Perm.UNCLAIM_AUTO.node;
|
||||
this.addRequirements(ReqHasPerm.get(node));
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -5,8 +5,8 @@ import java.util.Set;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
|
||||
|
||||
@ -29,9 +29,9 @@ public class CmdFactionsSetCircle extends CmdFactionsSetXRadius
|
||||
this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using circle.");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_CIRCLE.node : Perm.UNCLAIM_CIRCLE.node;
|
||||
this.addRequirements(ReqHasPerm.get(node));
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -7,8 +7,8 @@ import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
|
||||
@ -32,9 +32,9 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
|
||||
this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using fill.");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_FILL.node : Perm.UNCLAIM_FILL.node;
|
||||
this.addRequirements(ReqHasPerm.get(node));
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -4,8 +4,8 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
|
||||
|
||||
@ -24,9 +24,9 @@ public class CmdFactionsSetOne extends CmdFactionsSetXSimple
|
||||
this.addAliases("one");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_ONE.node : Perm.UNCLAIM_ONE.node;
|
||||
this.addRequirements(ReqHasPerm.get(node));
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -5,8 +5,8 @@ import java.util.Set;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
|
||||
|
||||
@ -29,9 +29,9 @@ public class CmdFactionsSetSquare extends CmdFactionsSetXRadius
|
||||
this.setFormatMany("<h>%s<i> %s <h>%d <i>chunks near %s<i> using square.");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_SQUARE.node : Perm.UNCLAIM_SQUARE.node;
|
||||
this.addRequirements(ReqHasPerm.get(node));
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeString;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||
|
||||
public abstract class CmdFactionsSetXAll extends CmdFactionsSetX
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeInteger;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeInteger;
|
||||
|
||||
|
||||
public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX
|
||||
|
@ -7,8 +7,8 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.event.EventFactionsHomeChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
|
||||
public class CmdFactionsSethome extends FactionsCommandHome
|
||||
@ -26,8 +26,8 @@ public class CmdFactionsSethome extends FactionsCommandHome
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.SETHOME.node));
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SETHOME.node));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -6,8 +6,8 @@ import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.event.EventFactionsPowerChange;
|
||||
import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeDouble;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||
|
||||
public class CmdFactionsSetpower extends FactionsCommand
|
||||
{
|
||||
@ -25,7 +25,7 @@ public class CmdFactionsSetpower extends FactionsCommand
|
||||
this.addParameter(TypeDouble.get(), "power");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.SETPOWER.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SETPOWER.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -13,8 +13,8 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.Parameter;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.Parameter;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.pager.Pager;
|
||||
import com.massivecraft.massivecore.pager.Stringifier;
|
||||
import com.massivecraft.massivecore.util.TimeDiffUtil;
|
||||
@ -39,7 +39,7 @@ public class CmdFactionsStatus extends FactionsCommand
|
||||
this.addParameter(TypeSortMPlayer.get(), "sort by", "time");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.STATUS.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.STATUS.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -2,10 +2,10 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.Visibility;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqTitlesAvailable;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeBoolean;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementTitlesAvailable;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
|
||||
import com.massivecraft.massivecore.mixin.Mixin;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
@ -21,11 +21,11 @@ public class CmdFactionsTerritorytitles extends FactionsCommand
|
||||
this.addAliases("tt", "territorytitles");
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeBoolean.get(), "on|off", "toggle");
|
||||
this.addParameter(TypeBoolean.getOn(), "on|off", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.TERRITORYTITLES.node));
|
||||
this.addRequirements(ReqTitlesAvailable.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.TERRITORYTITLES.node));
|
||||
this.addRequirements(RequirementTitlesAvailable.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -8,8 +8,8 @@ import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.event.EventFactionsTitleChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeString;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsTitle extends FactionsCommand
|
||||
@ -28,7 +28,7 @@ public class CmdFactionsTitle extends FactionsCommand
|
||||
this.addParameter(TypeString.get(), "title", "", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.TITLE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.TITLE.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
|
||||
public class CmdFactionsUnclaim extends FactionsCommand
|
||||
@ -35,7 +35,7 @@ public class CmdFactionsUnclaim extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsUnclaimAll);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNCLAIM.node));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.event.EventFactionsHomeChange;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactionsUnsethome extends FactionsCommandHome
|
||||
{
|
||||
@ -23,7 +23,7 @@ public class CmdFactionsUnsethome extends FactionsCommandHome
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.UNSETHOME.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNSETHOME.node));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -14,8 +14,8 @@ import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||
import com.massivecraft.massivecore.mixin.Mixin;
|
||||
import com.massivecraft.massivecore.mixin.TeleporterException;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
@ -34,8 +34,8 @@ public class CmdFactionsUnstuck extends FactionsCommand
|
||||
this.addAliases("unstuck");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.UNSTUCK.node));
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNSTUCK.node));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -36,7 +36,7 @@ public class CmdFactionsXPlaceholder extends FactionsCommand
|
||||
{
|
||||
msg("<b>The extension <h>%s <b>isn't installed.", this.extensionName);
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||
|
||||
public class FactionsCommand extends MassiveCommand
|
||||
{
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.cmd.req.ReqFactionHomesEnabled;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.cmd.Visibility;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
|
||||
public class FactionsCommandHome extends FactionsCommand
|
||||
{
|
||||
|
@ -4,11 +4,11 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ReqBankCommandsEnabled extends ReqAbstract
|
||||
public class ReqBankCommandsEnabled extends RequirementAbstract
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -3,11 +3,11 @@ package com.massivecraft.factions.cmd.req;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ReqFactionHomesEnabled extends ReqAbstract
|
||||
public class ReqFactionHomesEnabled extends RequirementAbstract
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -3,12 +3,12 @@ package com.massivecraft.factions.cmd.req;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ReqHasFaction extends ReqAbstract
|
||||
public class ReqHasFaction extends RequirementAbstract
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -3,12 +3,12 @@ package com.massivecraft.factions.cmd.req;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ReqHasntFaction extends ReqAbstract
|
||||
public class ReqHasntFaction extends RequirementAbstract
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -4,12 +4,12 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.cmd.MassiveCommand;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
|
||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementAbstract;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ReqRoleIsAtLeast extends ReqAbstract
|
||||
public class ReqRoleIsAtLeast extends RequirementAbstract
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.MPlayerColl;
|
||||
import com.massivecraft.massivecore.CaseInsensitiveComparator;
|
||||
import com.massivecraft.massivecore.MassiveCore;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAbstract;
|
||||
import com.massivecraft.massivecore.command.type.TypeAbstract;
|
||||
import com.massivecraft.massivecore.util.IdUtil;
|
||||
|
||||
public class TypeFaction extends TypeAbstract<Faction>
|
||||
@ -30,6 +30,18 @@ public class TypeFaction extends TypeAbstract<Faction>
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public String getVisualInner(Faction value, CommandSender sender)
|
||||
{
|
||||
return value.describeTo(MPlayer.get(sender));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameInner(Faction value)
|
||||
{
|
||||
return ChatColor.stripColor(value.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Faction read(String str, CommandSender sender) throws MassiveException
|
||||
{
|
||||
|
@ -1,17 +1,12 @@
|
||||
package com.massivecraft.factions.cmd.type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAllAble;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
import com.massivecraft.factions.entity.MFlagColl;
|
||||
import com.massivecraft.massivecore.command.type.store.TypeEntity;
|
||||
|
||||
public class TypeMFlag extends TypeAbstractSelect<MFlag> implements TypeAllAble<MFlag>
|
||||
public class TypeMFlag extends TypeEntity<MFlag>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
@ -19,6 +14,10 @@ public class TypeMFlag extends TypeAbstractSelect<MFlag> implements TypeAllAble<
|
||||
|
||||
private static TypeMFlag i = new TypeMFlag();
|
||||
public static TypeMFlag get() { return i; }
|
||||
public TypeMFlag()
|
||||
{
|
||||
super(MFlagColl.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
@ -31,71 +30,9 @@ public class TypeMFlag extends TypeAbstractSelect<MFlag> implements TypeAllAble<
|
||||
}
|
||||
|
||||
@Override
|
||||
public MFlag select(String arg, CommandSender sender)
|
||||
{
|
||||
if (arg == null) return null;
|
||||
arg = getComparable(arg);
|
||||
|
||||
// Algorithmic General Detection
|
||||
int startswithCount = 0;
|
||||
MFlag startswith = null;
|
||||
for (MFlag mflag : MFlag.getAll())
|
||||
{
|
||||
String comparable = getComparable(mflag);
|
||||
if (comparable.equals(arg)) return mflag;
|
||||
if (comparable.startsWith(arg))
|
||||
{
|
||||
startswith = mflag;
|
||||
startswithCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (startswithCount == 1)
|
||||
{
|
||||
return startswith;
|
||||
}
|
||||
|
||||
// Nothing found
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<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)
|
||||
public Collection<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());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,17 +1,12 @@
|
||||
package com.massivecraft.factions.cmd.type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.MPerm;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAllAble;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
import com.massivecraft.factions.entity.MPermColl;
|
||||
import com.massivecraft.massivecore.command.type.store.TypeEntity;
|
||||
|
||||
public class TypeMPerm extends TypeAbstractSelect<MPerm> implements TypeAllAble<MPerm>
|
||||
public class TypeMPerm extends TypeEntity<MPerm>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
@ -19,6 +14,10 @@ public class TypeMPerm extends TypeAbstractSelect<MPerm> implements TypeAllAble<
|
||||
|
||||
private static TypeMPerm i = new TypeMPerm();
|
||||
public static TypeMPerm get() { return i; }
|
||||
public TypeMPerm()
|
||||
{
|
||||
super(MPermColl.get());
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
@ -31,71 +30,10 @@ public class TypeMPerm extends TypeAbstractSelect<MPerm> implements TypeAllAble<
|
||||
}
|
||||
|
||||
@Override
|
||||
public MPerm select(String arg, CommandSender sender)
|
||||
{
|
||||
if (arg == null) return null;
|
||||
arg = getComparable(arg);
|
||||
|
||||
// Algorithmic General Detection
|
||||
int startswithCount = 0;
|
||||
MPerm startswith = null;
|
||||
for (MPerm mperm : MPerm.getAll())
|
||||
{
|
||||
String comparable = getComparable(mperm);
|
||||
if (comparable.equals(arg)) return mperm;
|
||||
if (comparable.startsWith(arg))
|
||||
{
|
||||
startswith = mperm;
|
||||
startswithCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (startswithCount == 1)
|
||||
{
|
||||
return startswith;
|
||||
}
|
||||
|
||||
// Nothing found
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<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)
|
||||
public Collection<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());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd.type;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.MPlayerColl;
|
||||
import com.massivecraft.massivecore.cmd.type.Type;
|
||||
import com.massivecraft.massivecore.command.type.Type;
|
||||
|
||||
public class TypeMPlayer
|
||||
{
|
||||
|
@ -1,55 +1,52 @@
|
||||
package com.massivecraft.factions.cmd.type;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import java.util.Set;
|
||||
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
import com.massivecraft.massivecore.collections.MassiveSet;
|
||||
import com.massivecraft.massivecore.command.type.enumeration.TypeEnum;
|
||||
|
||||
public class TypeRank extends TypeAbstractSelect<Rel>
|
||||
public class TypeRank extends TypeEnum<Rel>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// CONSTANTS
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static final List<String> ALT_NAMES = Collections.unmodifiableList(MUtil.list(
|
||||
Txt.getNicedEnum(Rel.LEADER),
|
||||
Txt.getNicedEnum(Rel.OFFICER),
|
||||
Txt.getNicedEnum(Rel.MEMBER),
|
||||
Txt.getNicedEnum(Rel.RECRUIT),
|
||||
"Promote",
|
||||
"Demote"
|
||||
));
|
||||
public static final Set<String> NAMES_PROMOTE = new MassiveSet<String>(
|
||||
"Promote",
|
||||
"+",
|
||||
"Plus",
|
||||
"Up"
|
||||
);
|
||||
|
||||
public static final Set<String> NAMES_DEMOTE = new MassiveSet<String>(
|
||||
"Demote",
|
||||
"-",
|
||||
"Minus",
|
||||
"Down"
|
||||
);
|
||||
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
// Default constructor. Can't use promote and demote.
|
||||
private static TypeRank i = new TypeRank();
|
||||
public static TypeRank get() { return i; }
|
||||
|
||||
public TypeRank()
|
||||
{
|
||||
this.startRank = null;
|
||||
}
|
||||
|
||||
// Fancy constructor. Can use promote and demote.
|
||||
// Can be used to promote and demote.
|
||||
public static TypeRank get(Rel rank) { return new TypeRank(rank); }
|
||||
|
||||
public TypeRank(Rel rank)
|
||||
{
|
||||
if (rank == null) throw new IllegalArgumentException("Do not use null, the default constructor can be used however.");
|
||||
if ( ! rank.isRank()) throw new IllegalArgumentException(rank + " is not a valid rank");
|
||||
super(Rel.class);
|
||||
if (rank != null && ! rank.isRank()) throw new IllegalArgumentException(rank + " is not a valid rank");
|
||||
this.startRank = rank;
|
||||
}
|
||||
|
||||
// Can not be used to promote and demote.
|
||||
private static TypeRank i = new TypeRank();
|
||||
public static TypeRank get() { return i; }
|
||||
public TypeRank()
|
||||
{
|
||||
this(null);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
@ -63,106 +60,48 @@ public class TypeRank extends TypeAbstractSelect<Rel>
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public Rel select(String arg, CommandSender sender) throws MassiveException
|
||||
public String getTypeName()
|
||||
{
|
||||
// This is especially useful when one rank can have aliases.
|
||||
// In the case of promote/demote,
|
||||
// that would require 10 lines of code repeated for each alias.
|
||||
arg = getComparable(arg);
|
||||
|
||||
// All the normal ranks
|
||||
if (arg.equals("leader")) return Rel.LEADER;
|
||||
if (arg.equals("officer")) return Rel.OFFICER;
|
||||
if (arg.equals("member")) return Rel.MEMBER;
|
||||
if (arg.equals("recruit")) return Rel.RECRUIT;
|
||||
|
||||
// No start rank?
|
||||
if (startRank == null && (arg.equals("promote") || arg.equals("demote")))
|
||||
{
|
||||
// This might happen if the default constructor is used
|
||||
throw new MassiveException().addMsg("<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;
|
||||
return "rank";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> altNames(CommandSender sender)
|
||||
public Set<String> getNamesInner(Rel value)
|
||||
{
|
||||
return ALT_NAMES;
|
||||
}
|
||||
// Create
|
||||
Set<String> ret = super.getNamesInner(value);
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<String> getTabList(CommandSender sender, String arg)
|
||||
{
|
||||
return this.altNames(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String arg, CommandSender sender)
|
||||
{
|
||||
try
|
||||
// Fill Exact
|
||||
if (value == Rel.LEADER)
|
||||
{
|
||||
return this.select(arg, sender) != null;
|
||||
ret.add("admin");
|
||||
}
|
||||
catch (MassiveException e)
|
||||
else if (value == Rel.OFFICER)
|
||||
{
|
||||
return true;
|
||||
ret.add("moderator");
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// ARG
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static String getComparable(String str)
|
||||
{
|
||||
String ret = str.toLowerCase();
|
||||
|
||||
if (ret.startsWith("admin") || ret.startsWith("lea"))
|
||||
else if (value == Rel.MEMBER)
|
||||
{
|
||||
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";
|
||||
ret.add("member");
|
||||
ret.add("normal");
|
||||
}
|
||||
|
||||
// Fill Relative
|
||||
Rel start = this.getStartRank();
|
||||
if (start != null)
|
||||
{
|
||||
if (value == Rel.LEADER && start == Rel.OFFICER) ret.addAll(NAMES_PROMOTE);
|
||||
|
||||
if (value == Rel.OFFICER && start == Rel.MEMBER) ret.addAll(NAMES_PROMOTE);
|
||||
if (value == Rel.OFFICER && start == Rel.LEADER) ret.addAll(NAMES_DEMOTE);
|
||||
|
||||
if (value == Rel.MEMBER && start == Rel.RECRUIT) ret.addAll(NAMES_PROMOTE);
|
||||
if (value == Rel.MEMBER && start == Rel.OFFICER) ret.addAll(NAMES_DEMOTE);
|
||||
|
||||
if (value == Rel.RECRUIT && start == Rel.MEMBER) ret.addAll(NAMES_DEMOTE);
|
||||
}
|
||||
|
||||
// Return
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,11 @@
|
||||
package com.massivecraft.factions.cmd.type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import java.util.Set;
|
||||
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
import com.massivecraft.massivecore.command.type.enumeration.TypeEnum;
|
||||
|
||||
public class TypeRel extends TypeAbstractSelect<Rel>
|
||||
public class TypeRel extends TypeEnum<Rel>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
@ -18,6 +13,7 @@ public class TypeRel extends TypeAbstractSelect<Rel>
|
||||
|
||||
private static TypeRel i = new TypeRel();
|
||||
public static TypeRel get() { return i; }
|
||||
public TypeRel() { super(Rel.class); }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
@ -30,28 +26,24 @@ public class TypeRel extends TypeAbstractSelect<Rel>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rel select(String str, CommandSender sender)
|
||||
public Set<String> getNamesInner(Rel value)
|
||||
{
|
||||
return Rel.parse(str);
|
||||
}
|
||||
Set<String> ret = super.getNamesInner(value);
|
||||
|
||||
@Override
|
||||
public Collection<String> altNames(CommandSender sender)
|
||||
{
|
||||
List<String> ret = new ArrayList<String>();
|
||||
|
||||
for (Rel rel : Rel.values())
|
||||
if (value == Rel.LEADER)
|
||||
{
|
||||
ret.add(Txt.getNicedEnum(rel));
|
||||
ret.add("admin");
|
||||
}
|
||||
else if (value == Rel.OFFICER)
|
||||
{
|
||||
ret.add("moderator");
|
||||
}
|
||||
else if (value == Rel.MEMBER)
|
||||
{
|
||||
ret.add("normal");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getTabList(CommandSender sender, String arg)
|
||||
{
|
||||
return this.altNames(sender);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,27 +1,17 @@
|
||||
package com.massivecraft.factions.cmd.type;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.PlayerInactivityComparator;
|
||||
import com.massivecraft.factions.PlayerPowerComparator;
|
||||
import com.massivecraft.factions.PlayerRoleComparator;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.cmd.type.TypeAbstractSelect;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.collections.MassiveList;
|
||||
import com.massivecraft.massivecore.command.type.TypeAbstractChoice;
|
||||
|
||||
public class TypeSortMPlayer extends TypeAbstractSelect<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
|
||||
// -------------------------------------------- //
|
||||
@ -39,40 +29,17 @@ public class TypeSortMPlayer extends TypeAbstractSelect<Comparator<MPlayer>>
|
||||
return "player sorter";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Comparator<MPlayer> select(String sortedBy, CommandSender sender)
|
||||
public Collection<Comparator<MPlayer>> getAll()
|
||||
{
|
||||
sortedBy = sortedBy.toLowerCase();
|
||||
|
||||
if (sortedBy.startsWith("r"))
|
||||
{
|
||||
// Sort by rank
|
||||
return PlayerRoleComparator.get();
|
||||
}
|
||||
else if (sortedBy.startsWith("p"))
|
||||
{
|
||||
// Sort by power
|
||||
return PlayerPowerComparator.get();
|
||||
}
|
||||
else if (sortedBy.startsWith("t"))
|
||||
{
|
||||
// Sort by time
|
||||
return PlayerInactivityComparator.get();
|
||||
}
|
||||
|
||||
return null;
|
||||
return new MassiveList<Comparator<MPlayer>>(
|
||||
PlayerRoleComparator.get(),
|
||||
PlayerPowerComparator.get(),
|
||||
PlayerInactivityComparator.get()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> altNames(CommandSender sender)
|
||||
{
|
||||
return ALT_NAMES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getTabList(CommandSender sender, String arg)
|
||||
{
|
||||
return this.altNames(sender);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.RelationParticipator;
|
||||
import com.massivecraft.factions.util.*;
|
||||
import com.massivecraft.massivecore.CaseInsensitiveComparator;
|
||||
import com.massivecraft.massivecore.Named;
|
||||
import com.massivecraft.massivecore.collections.MassiveMapDef;
|
||||
import com.massivecraft.massivecore.collections.MassiveTreeSetDef;
|
||||
import com.massivecraft.massivecore.mixin.Mixin;
|
||||
@ -25,7 +26,7 @@ import com.massivecraft.massivecore.util.IdUtil;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
public class Faction extends Entity<Faction> implements EconomyParticipator, Named
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// META
|
||||
@ -154,6 +155,7 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
|
||||
// RAW
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
String ret = this.name;
|
||||
|
@ -3,6 +3,7 @@ package com.massivecraft.factions.entity;
|
||||
import java.util.List;
|
||||
|
||||
import com.massivecraft.factions.event.EventFactionsCreateFlags;
|
||||
import com.massivecraft.massivecore.Named;
|
||||
import com.massivecraft.massivecore.PredicateIsRegistered;
|
||||
import com.massivecraft.massivecore.Prioritized;
|
||||
import com.massivecraft.massivecore.PriorityComparator;
|
||||
@ -11,7 +12,7 @@ import com.massivecraft.massivecore.collections.MassiveList;
|
||||
import com.massivecraft.massivecore.store.Entity;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class MFlag extends Entity<MFlag> implements Prioritized, Registerable
|
||||
public class MFlag extends Entity<MFlag> implements Prioritized, Registerable, Named
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// 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.
|
||||
// Example: "monsters"
|
||||
private String name = "defaultName";
|
||||
public String getName() { return this.name; }
|
||||
@Override public String getName() { return this.name; }
|
||||
public MFlag setName(String name) { this.name = name; this.changed(); return this; }
|
||||
|
||||
// The flag function described as a question.
|
||||
|
@ -12,6 +12,7 @@ import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.TerritoryAccess;
|
||||
import com.massivecraft.factions.event.EventFactionsCreatePerms;
|
||||
import com.massivecraft.massivecore.Named;
|
||||
import com.massivecraft.massivecore.PredicateIsRegistered;
|
||||
import com.massivecraft.massivecore.Prioritized;
|
||||
import com.massivecraft.massivecore.PriorityComparator;
|
||||
@ -21,7 +22,7 @@ import com.massivecraft.massivecore.store.Entity;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class MPerm extends Entity<MPerm> implements Prioritized, Registerable
|
||||
public class MPerm extends Entity<MPerm> implements Prioritized, Registerable, Named
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// 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.
|
||||
// Example: "build"
|
||||
private String name = "defaultName";
|
||||
public String getName() { return this.name; }
|
||||
@Override public String getName() { return this.name; }
|
||||
public MPerm setName(String name) { this.name = name; this.changed(); return this; }
|
||||
|
||||
// The perm function described as an "order".
|
||||
|
Loading…
Reference in New Issue
Block a user