Factions/src/com/massivecraft/factions/cmd/FCmdRoot.java

122 lines
4.5 KiB
Java
Raw Normal View History

2011-10-09 21:57:43 +02:00
package com.massivecraft.factions.cmd;
2011-10-09 20:10:19 +02:00
import java.util.Collections;
2011-10-09 20:10:19 +02:00
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
2011-10-09 20:10:19 +02:00
public class FCmdRoot extends FCommand
{
New "access" system to replace old ownership system. Access can be granted to build, destroy, and fully interact within any chunk for specific players or factions. Access can also optionally be denied to normal members of the host faction. Some further info display to go with this feature is yet to come, and further testing for possible bugs is also needed. Related info: New FPerm "ACCESS" which is granted to faction leaders and officers by default. This FPerm allows you to bypass access restrictions throughout your faction territory, and (along with the "factions.access" Bukkit permission below) allows you to change access settings for any chunk owned by your faction. New permissions: factions.access - Ability to grant territory access for your faction, if you have the proper "ACCESS" FPerm (defaults to leaders and officers only). Added to factions.kit.halfplayer permission kit. factions.access.any - Ability to grant territory access for any faction on the server. Added to factions.kit.mod permission kit. factions.access.view - Ability to view territory access info for your own faction. Added to factions.kit.halfplayer permission kit. New command: /f access [view|p|f|player|faction=view] [name=you] - view or change the access information for the chunk you are in. If "view" or nothing is specified, it will simply display the info. If "p" or "player" is specified, a player will be granted access, or removed from the list if they were already granted access. If "f" or "faction" is specified, the same will be done for the specified faction. The name defaults to yourself or your faction if not specified. If your own faction is specified, you will toggle restricted access for the chunk so that normal faction members can be denied access, unless they are in the access list. Examples: /f access - view access list, if in your own territory /f access p SomePlayer - grant access to player "SomePlayer" for the current chunk, or remove them from the access list if already there /f access f - toggle restricted access for the current chunk (since faction name isn't specified, uses your own faction), assuming you're in your own factions territory
2012-05-15 04:41:13 +02:00
public CmdAccess cmdAccess = new CmdAccess();
2011-10-23 17:55:53 +02:00
public CmdLeader cmdLeader = new CmdLeader();
2011-10-09 20:10:19 +02:00
public CmdAutoClaim cmdAutoClaim = new CmdAutoClaim();
public CmdAdmin cmdBypass = new CmdAdmin();
public CmdCape cmdCape = new CmdCape();
2011-10-09 20:10:19 +02:00
public CmdClaim cmdClaim = new CmdClaim();
public CmdConfig cmdConfig = new CmdConfig();
public CmdCreate cmdCreate = new CmdCreate();
public CmdDeinvite cmdDeinvite = new CmdDeinvite();
public CmdDescription cmdDescription = new CmdDescription();
public CmdDisband cmdDisband = new CmdDisband();
2011-10-23 20:50:49 +02:00
public CmdFlag cmdFlag = new CmdFlag();
2011-10-09 20:10:19 +02:00
public CmdHome cmdHome = new CmdHome();
public CmdInvite cmdInvite = new CmdInvite();
public CmdJoin cmdJoin = new CmdJoin();
public CmdKick cmdKick = new CmdKick();
public CmdLeave cmdLeave = new CmdLeave();
public CmdList cmdList = new CmdList();
public CmdLock cmdLock = new CmdLock();
public CmdMap cmdMap = new CmdMap();
2011-10-23 17:55:53 +02:00
public CmdOfficer cmdOfficer = new CmdOfficer();
public CmdMoney cmdMoney = new CmdMoney();
2011-10-09 20:10:19 +02:00
public CmdOpen cmdOpen = new CmdOpen();
public CmdPerm cmdPerm = new CmdPerm();
2011-10-09 20:10:19 +02:00
public CmdPower cmdPower = new CmdPower();
public CmdPowerBoost cmdPowerBoost = new CmdPowerBoost();
2011-10-09 20:10:19 +02:00
public CmdRelationAlly cmdRelationAlly = new CmdRelationAlly();
public CmdRelationEnemy cmdRelationEnemy = new CmdRelationEnemy();
public CmdRelationNeutral cmdRelationNeutral = new CmdRelationNeutral();
2011-10-23 22:08:57 +02:00
public CmdRelationTruce cmdRelationTruce = new CmdRelationTruce();
2011-10-09 20:10:19 +02:00
public CmdReload cmdReload = new CmdReload();
public CmdSaveAll cmdSaveAll = new CmdSaveAll();
public CmdSeeChunk cmdSeeChunks = new CmdSeeChunk();
2011-10-09 20:10:19 +02:00
public CmdSethome cmdSethome = new CmdSethome();
public CmdShow cmdShow = new CmdShow();
public CmdTag cmdTag = new CmdTag();
public CmdTitle cmdTitle = new CmdTitle();
public CmdUnclaim cmdUnclaim = new CmdUnclaim();
public CmdUnclaimall cmdUnclaimall = new CmdUnclaimall();
public CmdVersion cmdVersion = new CmdVersion();
public FCmdRoot()
{
super();
this.aliases.addAll(Conf.baseCommandAliases);
this.aliases.removeAll(Collections.singletonList(null)); // remove any nulls from extra commas
2011-10-09 20:10:19 +02:00
this.allowNoSlashAccess = Conf.allowNoSlashCommand;
//this.requiredArgs.add("");
//this.optionalArgs.put("","")
2011-10-09 20:10:19 +02:00
senderMustBePlayer = false;
senderMustBeMember = false;
2011-10-23 17:55:53 +02:00
senderMustBeOfficer = false;
senderMustBeLeader = false;
2011-10-09 20:10:19 +02:00
2011-10-09 21:57:43 +02:00
this.disableOnLock = false;
2011-10-09 20:10:19 +02:00
this.setHelpShort("The faction base command");
2011-10-10 13:31:25 +02:00
this.helpLong.add(p.txt.parseTags("<i>This command contains all faction stuff."));
2011-10-09 20:10:19 +02:00
this.addSubCommand(P.p.cmdAutoHelp);
this.addSubCommand(this.cmdList);
this.addSubCommand(this.cmdShow);
this.addSubCommand(this.cmdPower);
this.addSubCommand(this.cmdJoin);
this.addSubCommand(this.cmdLeave);
this.addSubCommand(this.cmdHome);
2011-10-10 01:21:05 +02:00
this.addSubCommand(this.cmdCreate);
this.addSubCommand(this.cmdSethome);
this.addSubCommand(this.cmdTag);
2011-10-10 01:21:05 +02:00
this.addSubCommand(this.cmdDescription);
this.addSubCommand(this.cmdCape);
this.addSubCommand(this.cmdPerm);
2011-10-23 20:50:49 +02:00
this.addSubCommand(this.cmdFlag);
2011-10-10 01:21:05 +02:00
this.addSubCommand(this.cmdInvite);
this.addSubCommand(this.cmdDeinvite);
this.addSubCommand(this.cmdOpen);
this.addSubCommand(this.cmdMoney);
this.addSubCommand(this.cmdClaim);
this.addSubCommand(this.cmdAutoClaim);
this.addSubCommand(this.cmdUnclaim);
this.addSubCommand(this.cmdUnclaimall);
New "access" system to replace old ownership system. Access can be granted to build, destroy, and fully interact within any chunk for specific players or factions. Access can also optionally be denied to normal members of the host faction. Some further info display to go with this feature is yet to come, and further testing for possible bugs is also needed. Related info: New FPerm "ACCESS" which is granted to faction leaders and officers by default. This FPerm allows you to bypass access restrictions throughout your faction territory, and (along with the "factions.access" Bukkit permission below) allows you to change access settings for any chunk owned by your faction. New permissions: factions.access - Ability to grant territory access for your faction, if you have the proper "ACCESS" FPerm (defaults to leaders and officers only). Added to factions.kit.halfplayer permission kit. factions.access.any - Ability to grant territory access for any faction on the server. Added to factions.kit.mod permission kit. factions.access.view - Ability to view territory access info for your own faction. Added to factions.kit.halfplayer permission kit. New command: /f access [view|p|f|player|faction=view] [name=you] - view or change the access information for the chunk you are in. If "view" or nothing is specified, it will simply display the info. If "p" or "player" is specified, a player will be granted access, or removed from the list if they were already granted access. If "f" or "faction" is specified, the same will be done for the specified faction. The name defaults to yourself or your faction if not specified. If your own faction is specified, you will toggle restricted access for the chunk so that normal faction members can be denied access, unless they are in the access list. Examples: /f access - view access list, if in your own territory /f access p SomePlayer - grant access to player "SomePlayer" for the current chunk, or remove them from the access list if already there /f access f - toggle restricted access for the current chunk (since faction name isn't specified, uses your own faction), assuming you're in your own factions territory
2012-05-15 04:41:13 +02:00
this.addSubCommand(this.cmdAccess);
2011-10-10 01:21:05 +02:00
this.addSubCommand(this.cmdKick);
2011-10-23 17:55:53 +02:00
this.addSubCommand(this.cmdOfficer);
this.addSubCommand(this.cmdLeader);
this.addSubCommand(this.cmdTitle);
this.addSubCommand(this.cmdMap);
this.addSubCommand(this.cmdSeeChunks);
this.addSubCommand(this.cmdDisband);
2011-10-10 01:21:05 +02:00
this.addSubCommand(this.cmdRelationAlly);
this.addSubCommand(this.cmdRelationEnemy);
this.addSubCommand(this.cmdRelationNeutral);
2011-10-23 22:08:57 +02:00
this.addSubCommand(this.cmdRelationTruce);
this.addSubCommand(this.cmdBypass);
this.addSubCommand(this.cmdPowerBoost);
this.addSubCommand(this.cmdLock);
2011-10-10 01:21:05 +02:00
this.addSubCommand(this.cmdReload);
this.addSubCommand(this.cmdConfig);
2011-10-10 01:21:05 +02:00
this.addSubCommand(this.cmdSaveAll);
this.addSubCommand(this.cmdVersion);
2011-10-09 20:10:19 +02:00
}
@Override
public void perform()
{
this.commandChain.add(this);
P.p.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
2011-10-09 20:10:19 +02:00
}
}