mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-22 10:15:51 +01:00
MassiveCore - Permission System Improvements
This commit is contained in:
parent
81a0b16e96
commit
799d931050
@ -2,9 +2,10 @@ package com.massivecraft.factions;
|
||||
|
||||
import org.bukkit.permissions.Permissible;
|
||||
|
||||
import com.massivecraft.massivecore.Identified;
|
||||
import com.massivecraft.massivecore.util.PermissionUtil;
|
||||
|
||||
public enum Perm
|
||||
public enum Perm implements Identified
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// ENUM
|
||||
@ -93,7 +94,8 @@ public enum Perm
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
public final String node;
|
||||
private final String id;
|
||||
@Override public String getId() { return this.id; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
@ -101,7 +103,7 @@ public enum 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)
|
||||
{
|
||||
return PermissionUtil.hasPermission(permissible, this.node, informSenderIfNot);
|
||||
return PermissionUtil.hasPermission(permissible, this.id, informSenderIfNot);
|
||||
}
|
||||
|
||||
public boolean has(Permissible permissible)
|
||||
|
@ -7,6 +7,7 @@ import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.command.MassiveCommandDeprecated;
|
||||
import com.massivecraft.massivecore.command.MassiveCommandVersion;
|
||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||
|
||||
public class CmdFactions extends FactionsCommand
|
||||
{
|
||||
@ -67,7 +68,7 @@ public class CmdFactions extends FactionsCommand
|
||||
public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband();
|
||||
public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost();
|
||||
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
|
||||
|
@ -31,7 +31,7 @@ public class CmdFactionsAccess extends FactionsCommand
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract
|
||||
this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_FACTION.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_FACTION));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -25,7 +25,7 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract
|
||||
this.addParameter(TypeBoolean.getYes(), "yes/no", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_PLAYER.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_PLAYER));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -15,7 +15,7 @@ public class CmdFactionsAccessView extends CmdFactionsAccessAbstract
|
||||
this.addAliases("view");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_VIEW.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.ACCESS_VIEW));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -35,7 +35,7 @@ public class CmdFactionsClaim extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsClaimAll);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.CLAIM.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.CLAIM));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class CmdFactionsCreate extends FactionsCommand
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasntFaction.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.CREATE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.CREATE));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -25,7 +25,7 @@ public class CmdFactionsDescription extends FactionsCommand
|
||||
this.addParameter(TypeString.get(), "desc", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.DESCRIPTION.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.DESCRIPTION));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class CmdFactionsDisband extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.DISBAND.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.DISBAND));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -19,7 +19,7 @@ public class CmdFactionsExpansions extends FactionsCommand
|
||||
this.addAliases("expansions");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.EXPANSIONS.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.EXPANSIONS));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -31,7 +31,7 @@ public class CmdFactionsFaction extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FACTION.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FACTION));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -28,7 +28,7 @@ public class CmdFactionsFlag extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsFlagSet);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class CmdFactionsFlagList extends FactionsCommand
|
||||
this.addParameter(Parameter.getPage());
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_LIST));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -28,7 +28,7 @@ public class CmdFactionsFlagSet extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SET.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SET));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -30,7 +30,7 @@ public class CmdFactionsFlagShow extends FactionsCommand
|
||||
this.addParameter(TypeSet.get(TypeMFlag.get()), "flags", "all", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SHOW.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.FLAG_SHOW));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -40,7 +40,7 @@ public class CmdFactionsHome extends FactionsCommandHome
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.HOME.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.HOME));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class CmdFactionsInvite extends FactionsCommand
|
||||
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public class CmdFactionsInviteAdd extends FactionsCommand
|
||||
this.addParameter(TypeSet.get(TypeMPlayer.get()), "players", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_ADD.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_ADD));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -31,7 +31,7 @@ public class CmdFactionsInviteList extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_LIST));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -32,7 +32,7 @@ public class CmdFactionsInviteRemove extends FactionsCommand
|
||||
this.addParameter(TypeSet.get(TypeMPlayer.get()), "players/all", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_REMOVE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.INVITE_REMOVE));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -33,7 +33,7 @@ public class CmdFactionsJoin extends FactionsCommand
|
||||
this.addParameter(TypeMPlayer.get(), "player", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.JOIN.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.JOIN));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -32,7 +32,7 @@ public class CmdFactionsKick extends FactionsCommand
|
||||
this.addParameter(TypeMPlayer.get(), "player");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.KICK.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.KICK));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -16,7 +16,7 @@ public class CmdFactionsLeave extends FactionsCommand
|
||||
this.addAliases("leave");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.LEAVE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.LEAVE));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class CmdFactionsList extends FactionsCommand
|
||||
this.addParameter(Parameter.getPage());
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.LIST));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -28,7 +28,7 @@ public class CmdFactionsMap extends FactionsCommand
|
||||
this.addParameter(TypeBoolean.getOn(), "on/off", "once");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MAP.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MAP));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class CmdFactionsMoney extends FactionsCommand
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class CmdFactionsMoneyBalance extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_BALANCE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_BALANCE));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class CmdFactionsMoneyDeposit extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_DEPOSIT.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_DEPOSIT));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class CmdFactionsMoneyTransferFf extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2F.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2F));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferFp extends FactionsCommand
|
||||
this.addParameter(TypeMPlayer.get(), "player");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2P.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_F2P));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class CmdFactionsMoneyTransferPf extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_P2F.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_P2F));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class CmdFactionsMoneyWithdraw extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_WITHDRAW.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MONEY_WITHDRAW));
|
||||
this.addRequirements(ReqBankCommandsEnabled.get());
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class CmdFactionsMotd extends FactionsCommand
|
||||
this.addParameter(TypeString.get(), "new", "read", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MOTD.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.MOTD));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -29,7 +29,7 @@ public class CmdFactionsName extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.NAME.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.NAME));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -23,7 +23,7 @@ public class CmdFactionsOverride extends FactionsCommand
|
||||
this.addParameter(TypeBoolean.getOn(), "on/off", "flip");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.OVERRIDE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.OVERRIDE));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -28,7 +28,7 @@ public class CmdFactionsPerm extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsPermSet);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class CmdFactionsPermList extends FactionsCommand
|
||||
this.addParameter(Parameter.getPage());
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_LIST));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -35,7 +35,7 @@ public class CmdFactionsPermSet extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_SET.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_SET));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -30,7 +30,7 @@ public class CmdFactionsPermShow extends FactionsCommand
|
||||
this.addParameter(TypeSet.get(TypeMPerm.get()), "perms", "all", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_SHOW.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PERM_SHOW));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -30,7 +30,7 @@ public class CmdFactionsPlayer extends FactionsCommand
|
||||
this.addParameter(TypeMPlayer.get(), "player", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PLAYER.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.PLAYER));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -36,7 +36,7 @@ public class CmdFactionsPowerBoost extends FactionsCommand
|
||||
this.addParameter(TypeDouble.get(), "#");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.POWERBOOST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.POWERBOOST));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -63,7 +63,7 @@ public class CmdFactionsRank extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "their");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RANK.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RANK));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -29,7 +29,7 @@ public class CmdFactionsRelation extends FactionsCommand
|
||||
this.addAliases("relation");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class CmdFactionsRelationList extends FactionsCommand
|
||||
this.addParameter(TypeSet.get(TypeRelation.get()), "relations", "all");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_LIST.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_LIST));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -32,7 +32,7 @@ public class CmdFactionsRelationSet extends FactionsCommand
|
||||
this.addParameter(TypeRelation.get(), "relation");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_SET.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_SET));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -37,7 +37,7 @@ public class CmdFactionsRelationWishes extends FactionsCommand
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_WISHES.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_WISHES));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -22,7 +22,7 @@ public class CmdFactionsSeeChunk extends FactionsCommand
|
||||
this.addParameter(TypeBoolean.getOn(), "active", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNK.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNK));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ public class CmdFactionsSeeChunkOld extends FactionsCommand
|
||||
this.addAliases("sco", "seechunkold");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNKOLD.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SEECHUNKOLD));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,8 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll
|
||||
this.addAliases("all");
|
||||
|
||||
// Requirements
|
||||
String node = claim ? Perm.CLAIM_ALL.node : Perm.UNCLAIM_ALL.node;
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
Perm perm = claim ? Perm.CLAIM_ALL : Perm.UNCLAIM_ALL;
|
||||
this.addRequirements(RequirementHasPerm.get(perm));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -44,8 +44,8 @@ public class CmdFactionsSetAuto extends FactionsCommand
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_AUTO.node : Perm.UNCLAIM_AUTO.node;
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
Perm perm = claim ? Perm.CLAIM_AUTO : Perm.UNCLAIM_AUTO;
|
||||
this.addRequirements(RequirementHasPerm.get(perm));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -30,8 +30,8 @@ public class CmdFactionsSetCircle extends CmdFactionsSetXRadius
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_CIRCLE.node : Perm.UNCLAIM_CIRCLE.node;
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
Perm perm = claim ? Perm.CLAIM_CIRCLE : Perm.UNCLAIM_CIRCLE;
|
||||
this.addRequirements(RequirementHasPerm.get(perm));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -33,8 +33,8 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_FILL.node : Perm.UNCLAIM_FILL.node;
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
Perm perm = claim ? Perm.CLAIM_FILL : Perm.UNCLAIM_FILL;
|
||||
this.addRequirements(RequirementHasPerm.get(perm));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -25,8 +25,8 @@ public class CmdFactionsSetOne extends CmdFactionsSetXSimple
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_ONE.node : Perm.UNCLAIM_ONE.node;
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
Perm perm = claim ? Perm.CLAIM_ONE : Perm.UNCLAIM_ONE;
|
||||
this.addRequirements(RequirementHasPerm.get(perm));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -30,8 +30,8 @@ public class CmdFactionsSetSquare extends CmdFactionsSetXRadius
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
String node = claim ? Perm.CLAIM_SQUARE.node : Perm.UNCLAIM_SQUARE.node;
|
||||
this.addRequirements(RequirementHasPerm.get(node));
|
||||
Perm perm = claim ? Perm.CLAIM_SQUARE : Perm.UNCLAIM_SQUARE;
|
||||
this.addRequirements(RequirementHasPerm.get(perm));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -25,7 +25,7 @@ public class CmdFactionsSethome extends FactionsCommandHome
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SETHOME.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SETHOME));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class CmdFactionsSetpower extends FactionsCommand
|
||||
this.addParameter(TypeDouble.get(), "power");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SETPOWER.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.SETPOWER));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -39,7 +39,7 @@ public class CmdFactionsStatus extends FactionsCommand
|
||||
this.addParameter(TypeSortMPlayer.get(), "sort", "time");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.STATUS.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.STATUS));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -7,7 +7,6 @@ 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.MixinTitle;
|
||||
import com.massivecraft.massivecore.nms.NmsChat;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsTerritorytitles extends FactionsCommand
|
||||
@ -25,7 +24,7 @@ public class CmdFactionsTerritorytitles extends FactionsCommand
|
||||
this.addParameter(TypeBoolean.getOn(), "on|off", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.TERRITORYTITLES.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.TERRITORYTITLES));
|
||||
this.addRequirements(RequirementTitlesAvailable.get());
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class CmdFactionsTitle extends FactionsCommand
|
||||
this.addParameter(TypeString.get(), "title", "", true);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.TITLE.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.TITLE));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -35,7 +35,7 @@ public class CmdFactionsUnclaim extends FactionsCommand
|
||||
this.addChild(this.cmdFactionsUnclaimAll);
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNCLAIM.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNCLAIM));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class CmdFactionsUnsethome extends FactionsCommandHome
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNSETHOME.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNSETHOME));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -34,7 +34,7 @@ public class CmdFactionsUnstuck extends FactionsCommand
|
||||
this.addAliases("unstuck");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNSTUCK.node));
|
||||
this.addRequirements(RequirementHasPerm.get(Perm.UNSTUCK));
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user