MassiveCore - Permission System Improvements

This commit is contained in:
Olof Larsson 2016-05-26 10:17:44 +02:00
parent 81a0b16e96
commit 799d931050
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474
63 changed files with 75 additions and 73 deletions

View File

@ -2,9 +2,10 @@ package com.massivecraft.factions;
import org.bukkit.permissions.Permissible; import org.bukkit.permissions.Permissible;
import com.massivecraft.massivecore.Identified;
import com.massivecraft.massivecore.util.PermissionUtil; import com.massivecraft.massivecore.util.PermissionUtil;
public enum Perm public enum Perm implements Identified
{ {
// -------------------------------------------- // // -------------------------------------------- //
// ENUM // ENUM
@ -93,7 +94,8 @@ public enum Perm
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
public final String node; private final String id;
@Override public String getId() { return this.id; }
// -------------------------------------------- // // -------------------------------------------- //
// CONSTRUCT // CONSTRUCT
@ -101,7 +103,7 @@ public enum Perm
Perm() Perm()
{ {
this.node = "factions." + this.name().toLowerCase().replace('_', '.'); this.id = PermissionUtil.createPermissionId(Factions.get(), this);
} }
// -------------------------------------------- // // -------------------------------------------- //
@ -110,7 +112,7 @@ public enum Perm
public boolean has(Permissible permissible, boolean informSenderIfNot) public boolean has(Permissible permissible, boolean informSenderIfNot)
{ {
return PermissionUtil.hasPermission(permissible, this.node, informSenderIfNot); return PermissionUtil.hasPermission(permissible, this.id, informSenderIfNot);
} }
public boolean has(Permissible permissible) public boolean has(Permissible permissible)

View File

@ -7,6 +7,7 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.massivecore.command.MassiveCommandDeprecated; import com.massivecraft.massivecore.command.MassiveCommandDeprecated;
import com.massivecraft.massivecore.command.MassiveCommandVersion; import com.massivecraft.massivecore.command.MassiveCommandVersion;
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
public class CmdFactions extends FactionsCommand public class CmdFactions extends FactionsCommand
{ {
@ -67,7 +68,7 @@ public class CmdFactions extends FactionsCommand
public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband(); public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband();
public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost(); public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost();
public CmdFactionsSetpower cmdFactionsSetpower = new CmdFactionsSetpower(); public CmdFactionsSetpower cmdFactionsSetpower = new CmdFactionsSetpower();
public MassiveCommandVersion cmdFactionsVersion = new MassiveCommandVersion(Factions.get(), Perm.VERSION.node, "v", "version"); public MassiveCommandVersion cmdFactionsVersion = new MassiveCommandVersion(Factions.get()).setAliases("v", "version").addRequirements(RequirementHasPerm.get(Perm.VERSION));
// -------------------------------------------- // // -------------------------------------------- //
// CONSTRUCT // CONSTRUCT

View File

@ -31,7 +31,7 @@ public class CmdFactionsAccess extends FactionsCommand
// Requirements // Requirements
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS.node)); this.addRequirements(RequirementHasPerm.get(Perm.ACCESS));
} }
} }

View File

@ -25,7 +25,7 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract
this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle"); this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_FACTION.node)); this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_FACTION));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -25,7 +25,7 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract
this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle"); this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_PLAYER.node)); this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_PLAYER));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -15,7 +15,7 @@ public class CmdFactionsAccessView extends CmdFactionsAccessAbstract
this.addAliases("view"); this.addAliases("view");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_VIEW.node)); this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_VIEW));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -35,7 +35,7 @@ public class CmdFactionsClaim extends FactionsCommand
this.addChild(this.cmdFactionsClaimAll); this.addChild(this.cmdFactionsClaimAll);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.CLAIM.node)); this.addRequirements(RequirementHasPerm.get(Perm.CLAIM));
} }
} }

View File

@ -36,7 +36,7 @@ public class CmdFactionsCreate extends FactionsCommand
// Requirements // Requirements
this.addRequirements(ReqHasntFaction.get()); this.addRequirements(ReqHasntFaction.get());
this.addRequirements(RequirementHasPerm.get(Perm.CREATE.node)); this.addRequirements(RequirementHasPerm.get(Perm.CREATE));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -25,7 +25,7 @@ public class CmdFactionsDescription extends FactionsCommand
this.addParameter(TypeString.get(), "desc", true); this.addParameter(TypeString.get(), "desc", true);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.DESCRIPTION.node)); this.addRequirements(RequirementHasPerm.get(Perm.DESCRIPTION));
this.addRequirements(ReqHasFaction.get()); this.addRequirements(ReqHasFaction.get());
} }

View File

@ -32,7 +32,7 @@ public class CmdFactionsDisband extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.DISBAND.node)); this.addRequirements(RequirementHasPerm.get(Perm.DISBAND));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -19,7 +19,7 @@ public class CmdFactionsExpansions extends FactionsCommand
this.addAliases("expansions"); this.addAliases("expansions");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.EXPANSIONS.node)); this.addRequirements(RequirementHasPerm.get(Perm.EXPANSIONS));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -31,7 +31,7 @@ public class CmdFactionsFaction extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.FACTION.node)); this.addRequirements(RequirementHasPerm.get(Perm.FACTION));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -28,7 +28,7 @@ public class CmdFactionsFlag extends FactionsCommand
this.addChild(this.cmdFactionsFlagSet); this.addChild(this.cmdFactionsFlagSet);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.FLAG.node)); this.addRequirements(RequirementHasPerm.get(Perm.FLAG));
} }
} }

View File

@ -25,7 +25,7 @@ public class CmdFactionsFlagList extends FactionsCommand
this.addParameter(Parameter.getPage()); this.addParameter(Parameter.getPage());
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.FLAG_LIST));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -28,7 +28,7 @@ public class CmdFactionsFlagSet extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SET.node)); this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SET));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -30,7 +30,7 @@ public class CmdFactionsFlagShow extends FactionsCommand
this.addParameter(TypeSet.get(TypeMFlag.get()), "flags", "all", true); this.addParameter(TypeSet.get(TypeMFlag.get()), "flags", "all", true);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SHOW.node)); this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SHOW));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -40,7 +40,7 @@ public class CmdFactionsHome extends FactionsCommandHome
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.HOME.node)); this.addRequirements(RequirementHasPerm.get(Perm.HOME));
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }

View File

@ -29,7 +29,7 @@ public class CmdFactionsInvite extends FactionsCommand
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.INVITE.node)); this.addRequirements(RequirementHasPerm.get(Perm.INVITE));
} }
} }

View File

@ -29,7 +29,7 @@ public class CmdFactionsInviteAdd extends FactionsCommand
this.addParameter(TypeSet.get(TypeMPlayer.get()), "players", true); this.addParameter(TypeSet.get(TypeMPlayer.get()), "players", true);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_ADD.node)); this.addRequirements(RequirementHasPerm.get(Perm.INVITE_ADD));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -31,7 +31,7 @@ public class CmdFactionsInviteList extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.INVITE_LIST));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -32,7 +32,7 @@ public class CmdFactionsInviteRemove extends FactionsCommand
this.addParameter(TypeSet.get(TypeMPlayer.get()), "players/all", true); this.addParameter(TypeSet.get(TypeMPlayer.get()), "players/all", true);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_REMOVE.node)); this.addRequirements(RequirementHasPerm.get(Perm.INVITE_REMOVE));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -33,7 +33,7 @@ public class CmdFactionsJoin extends FactionsCommand
this.addParameter(TypeMPlayer.get(), "player", "you"); this.addParameter(TypeMPlayer.get(), "player", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.JOIN.node)); this.addRequirements(RequirementHasPerm.get(Perm.JOIN));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -32,7 +32,7 @@ public class CmdFactionsKick extends FactionsCommand
this.addParameter(TypeMPlayer.get(), "player"); this.addParameter(TypeMPlayer.get(), "player");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.KICK.node)); this.addRequirements(RequirementHasPerm.get(Perm.KICK));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -16,7 +16,7 @@ public class CmdFactionsLeave extends FactionsCommand
this.addAliases("leave"); this.addAliases("leave");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.LEAVE.node)); this.addRequirements(RequirementHasPerm.get(Perm.LEAVE));
this.addRequirements(ReqHasFaction.get()); this.addRequirements(ReqHasFaction.get());
} }

View File

@ -36,7 +36,7 @@ public class CmdFactionsList extends FactionsCommand
this.addParameter(Parameter.getPage()); this.addParameter(Parameter.getPage());
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.LIST));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -28,7 +28,7 @@ public class CmdFactionsMap extends FactionsCommand
this.addParameter(TypeBoolean.getOn(), "on/off", "once"); this.addParameter(TypeBoolean.getOn(), "on/off", "once");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.MAP.node)); this.addRequirements(RequirementHasPerm.get(Perm.MAP));
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }

View File

@ -36,7 +36,7 @@ public class CmdFactionsMoney extends FactionsCommand
// Requirements // Requirements
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
this.addRequirements(RequirementHasPerm.get(Perm.MONEY.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY));
} }
} }

View File

@ -23,7 +23,7 @@ public class CmdFactionsMoneyBalance extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_BALANCE.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_BALANCE));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -31,7 +31,7 @@ public class CmdFactionsMoneyDeposit extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_DEPOSIT.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_DEPOSIT));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -33,7 +33,7 @@ public class CmdFactionsMoneyTransferFf extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction"); this.addParameter(TypeFaction.get(), "faction");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2F.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2F));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferFp extends FactionsCommand
this.addParameter(TypeMPlayer.get(), "player"); this.addParameter(TypeMPlayer.get(), "player");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2P.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2P));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferPf extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction"); this.addParameter(TypeFaction.get(), "faction");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_P2F.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_P2F));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -33,7 +33,7 @@ public class CmdFactionsMoneyWithdraw extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_WITHDRAW.node)); this.addRequirements(RequirementHasPerm.get(Perm.MONEY_WITHDRAW));
this.addRequirements(ReqBankCommandsEnabled.get()); this.addRequirements(ReqBankCommandsEnabled.get());
} }

View File

@ -27,7 +27,7 @@ public class CmdFactionsMotd extends FactionsCommand
this.addParameter(TypeString.get(), "new", "read", true); this.addParameter(TypeString.get(), "new", "read", true);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.MOTD.node)); this.addRequirements(RequirementHasPerm.get(Perm.MOTD));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -29,7 +29,7 @@ public class CmdFactionsName extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.NAME.node)); this.addRequirements(RequirementHasPerm.get(Perm.NAME));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -23,7 +23,7 @@ public class CmdFactionsOverride extends FactionsCommand
this.addParameter(TypeBoolean.getOn(), "on/off", "flip"); this.addParameter(TypeBoolean.getOn(), "on/off", "flip");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.OVERRIDE.node)); this.addRequirements(RequirementHasPerm.get(Perm.OVERRIDE));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -28,7 +28,7 @@ public class CmdFactionsPerm extends FactionsCommand
this.addChild(this.cmdFactionsPermSet); this.addChild(this.cmdFactionsPermSet);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.PERM.node)); this.addRequirements(RequirementHasPerm.get(Perm.PERM));
} }
} }

View File

@ -25,7 +25,7 @@ public class CmdFactionsPermList extends FactionsCommand
this.addParameter(Parameter.getPage()); this.addParameter(Parameter.getPage());
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.PERM_LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.PERM_LIST));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -35,7 +35,7 @@ public class CmdFactionsPermSet extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.PERM_SET.node)); this.addRequirements(RequirementHasPerm.get(Perm.PERM_SET));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -30,7 +30,7 @@ public class CmdFactionsPermShow extends FactionsCommand
this.addParameter(TypeSet.get(TypeMPerm.get()), "perms", "all", true); this.addParameter(TypeSet.get(TypeMPerm.get()), "perms", "all", true);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.PERM_SHOW.node)); this.addRequirements(RequirementHasPerm.get(Perm.PERM_SHOW));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -30,7 +30,7 @@ public class CmdFactionsPlayer extends FactionsCommand
this.addParameter(TypeMPlayer.get(), "player", "you"); this.addParameter(TypeMPlayer.get(), "player", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.PLAYER.node)); this.addRequirements(RequirementHasPerm.get(Perm.PLAYER));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -36,7 +36,7 @@ public class CmdFactionsPowerBoost extends FactionsCommand
this.addParameter(TypeDouble.get(), "#"); this.addParameter(TypeDouble.get(), "#");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.POWERBOOST.node)); this.addRequirements(RequirementHasPerm.get(Perm.POWERBOOST));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -63,7 +63,7 @@ public class CmdFactionsRank extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "their"); this.addParameter(TypeFaction.get(), "faction", "their");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.RANK.node)); this.addRequirements(RequirementHasPerm.get(Perm.RANK));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -29,7 +29,7 @@ public class CmdFactionsRelation extends FactionsCommand
this.addAliases("relation"); this.addAliases("relation");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.RELATION.node)); this.addRequirements(RequirementHasPerm.get(Perm.RELATION));
} }
} }

View File

@ -48,7 +48,7 @@ public class CmdFactionsRelationList extends FactionsCommand
this.addParameter(TypeSet.get(TypeRelation.get()), "relations", "all"); this.addParameter(TypeSet.get(TypeRelation.get()), "relations", "all");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_LIST.node)); this.addRequirements(RequirementHasPerm.get(Perm.RELATION_LIST));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -32,7 +32,7 @@ public class CmdFactionsRelationSet extends FactionsCommand
this.addParameter(TypeRelation.get(), "relation"); this.addParameter(TypeRelation.get(), "relation");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_SET.node)); this.addRequirements(RequirementHasPerm.get(Perm.RELATION_SET));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -37,7 +37,7 @@ public class CmdFactionsRelationWishes extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_WISHES.node)); this.addRequirements(RequirementHasPerm.get(Perm.RELATION_WISHES));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -22,7 +22,7 @@ public class CmdFactionsSeeChunk extends FactionsCommand
this.addParameter(TypeBoolean.getOn(), "active", "toggle"); this.addParameter(TypeBoolean.getOn(), "active", "toggle");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNK.node)); this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNK));
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }

View File

@ -24,7 +24,7 @@ public class CmdFactionsSeeChunkOld extends FactionsCommand
this.addAliases("sco", "seechunkold"); this.addAliases("sco", "seechunkold");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNKOLD.node)); this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNKOLD));
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }

View File

@ -37,8 +37,8 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll
this.addAliases("all"); this.addAliases("all");
// Requirements // Requirements
String node = claim ? Perm.CLAIM_ALL.node : Perm.UNCLAIM_ALL.node; Perm perm = claim ? Perm.CLAIM_ALL : Perm.UNCLAIM_ALL;
this.addRequirements(RequirementHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(perm));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -44,8 +44,8 @@ public class CmdFactionsSetAuto extends FactionsCommand
// Requirements // Requirements
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_AUTO.node : Perm.UNCLAIM_AUTO.node; Perm perm = claim ? Perm.CLAIM_AUTO : Perm.UNCLAIM_AUTO;
this.addRequirements(RequirementHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(perm));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -30,8 +30,8 @@ public class CmdFactionsSetCircle extends CmdFactionsSetXRadius
// Requirements // Requirements
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_CIRCLE.node : Perm.UNCLAIM_CIRCLE.node; Perm perm = claim ? Perm.CLAIM_CIRCLE : Perm.UNCLAIM_CIRCLE;
this.addRequirements(RequirementHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(perm));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -33,8 +33,8 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
// Requirements // Requirements
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_FILL.node : Perm.UNCLAIM_FILL.node; Perm perm = claim ? Perm.CLAIM_FILL : Perm.UNCLAIM_FILL;
this.addRequirements(RequirementHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(perm));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -25,8 +25,8 @@ public class CmdFactionsSetOne extends CmdFactionsSetXSimple
// Requirements // Requirements
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_ONE.node : Perm.UNCLAIM_ONE.node; Perm perm = claim ? Perm.CLAIM_ONE : Perm.UNCLAIM_ONE;
this.addRequirements(RequirementHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(perm));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -30,8 +30,8 @@ public class CmdFactionsSetSquare extends CmdFactionsSetXRadius
// Requirements // Requirements
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
String node = claim ? Perm.CLAIM_SQUARE.node : Perm.UNCLAIM_SQUARE.node; Perm perm = claim ? Perm.CLAIM_SQUARE : Perm.UNCLAIM_SQUARE;
this.addRequirements(RequirementHasPerm.get(node)); this.addRequirements(RequirementHasPerm.get(perm));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -25,7 +25,7 @@ public class CmdFactionsSethome extends FactionsCommandHome
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.SETHOME.node)); this.addRequirements(RequirementHasPerm.get(Perm.SETHOME));
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }

View File

@ -25,7 +25,7 @@ public class CmdFactionsSetpower extends FactionsCommand
this.addParameter(TypeDouble.get(), "power"); this.addParameter(TypeDouble.get(), "power");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.SETPOWER.node)); this.addRequirements(RequirementHasPerm.get(Perm.SETPOWER));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -39,7 +39,7 @@ public class CmdFactionsStatus extends FactionsCommand
this.addParameter(TypeSortMPlayer.get(), "sort", "time"); this.addParameter(TypeSortMPlayer.get(), "sort", "time");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.STATUS.node)); this.addRequirements(RequirementHasPerm.get(Perm.STATUS));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -7,7 +7,6 @@ import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.command.requirement.RequirementTitlesAvailable; import com.massivecraft.massivecore.command.requirement.RequirementTitlesAvailable;
import com.massivecraft.massivecore.command.type.primitive.TypeBoolean; import com.massivecraft.massivecore.command.type.primitive.TypeBoolean;
import com.massivecraft.massivecore.mixin.MixinTitle; import com.massivecraft.massivecore.mixin.MixinTitle;
import com.massivecraft.massivecore.nms.NmsChat;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
public class CmdFactionsTerritorytitles extends FactionsCommand public class CmdFactionsTerritorytitles extends FactionsCommand
@ -25,7 +24,7 @@ public class CmdFactionsTerritorytitles extends FactionsCommand
this.addParameter(TypeBoolean.getOn(), "on|off", "toggle"); this.addParameter(TypeBoolean.getOn(), "on|off", "toggle");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.TERRITORYTITLES.node)); this.addRequirements(RequirementHasPerm.get(Perm.TERRITORYTITLES));
this.addRequirements(RequirementTitlesAvailable.get()); this.addRequirements(RequirementTitlesAvailable.get());
} }

View File

@ -28,7 +28,7 @@ public class CmdFactionsTitle extends FactionsCommand
this.addParameter(TypeString.get(), "title", "", true); this.addParameter(TypeString.get(), "title", "", true);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.TITLE.node)); this.addRequirements(RequirementHasPerm.get(Perm.TITLE));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -35,7 +35,7 @@ public class CmdFactionsUnclaim extends FactionsCommand
this.addChild(this.cmdFactionsUnclaimAll); this.addChild(this.cmdFactionsUnclaimAll);
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.UNCLAIM.node)); this.addRequirements(RequirementHasPerm.get(Perm.UNCLAIM));
} }
} }

View File

@ -23,7 +23,7 @@ public class CmdFactionsUnsethome extends FactionsCommandHome
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.UNSETHOME.node)); this.addRequirements(RequirementHasPerm.get(Perm.UNSETHOME));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -34,7 +34,7 @@ public class CmdFactionsUnstuck extends FactionsCommand
this.addAliases("unstuck"); this.addAliases("unstuck");
// Requirements // Requirements
this.addRequirements(RequirementHasPerm.get(Perm.UNSTUCK.node)); this.addRequirements(RequirementHasPerm.get(Perm.UNSTUCK));
this.addRequirements(RequirementIsPlayer.get()); this.addRequirements(RequirementIsPlayer.get());
} }