This is 2.2.2

This commit is contained in:
Olof Larsson
2013-11-11 09:31:04 +01:00
parent fa0c8686c1
commit 1a63c59c54
63 changed files with 651 additions and 171 deletions

View File

@@ -1,15 +1,19 @@
package com.massivecraft.factions.cmd;
import java.util.Collections;
import java.util.List;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.VersionCommand;
public class CmdFactions extends FCommand
{
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
public CmdFactionsList cmdFactionsList = new CmdFactionsList();
public CmdFactionsFaction cmdFactionsFaction = new CmdFactionsFaction();
public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer();
@@ -47,17 +51,13 @@ public class CmdFactions extends FCommand
public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost();
public VersionCommand cmdFactionsVersion = new VersionCommand(Factions.get(), Perm.VERSION.node, "v", "version");
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactions()
{
this.aliases.addAll(ConfServer.baseCommandAliases);
// remove any nulls from extra commas
// TODO: When is this required? Should this be added to MCore?
this.aliases.removeAll(Collections.singletonList(null));
this.setDesc("The faction base command");
this.setHelp("This command contains all faction stuff.");
// Add SubCommands
this.addSubCommand(HelpCommand.get());
this.addSubCommand(this.cmdFactionsList);
this.addSubCommand(this.cmdFactionsFaction);
@@ -95,13 +95,20 @@ public class CmdFactions extends FCommand
this.addSubCommand(this.cmdFactionsAdmin);
this.addSubCommand(this.cmdFactionsPowerBoost);
this.addSubCommand(this.cmdFactionsVersion);
// Misc
this.setDesc("The faction base command");
this.setHelp("This command contains all faction stuff.");
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
public List<String> getAliases()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
return MConf.get().aliasesF;
}
}

View File

@@ -9,28 +9,43 @@ import com.massivecraft.mcore.cmd.req.ReqIsPlayer;
public class CmdFactionsAccess extends FCommand
{
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
public CmdFactionsAccessView cmdFactionsAccessView = new CmdFactionsAccessView();
public CmdFactionsAccessPlayer cmdFactionsAccessPlayer = new CmdFactionsAccessPlayer();
public CmdFactionsAccessFaction cmdFactionsAccessFaction = new CmdFactionsAccessFaction();
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsAccess()
{
this.addAliases("access");
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqIsPlayer.get());
this.addRequirements(ReqHasPerm.get(Perm.ACCESS.node));
// Add SubCommands
this.addSubCommand(this.cmdFactionsAccessView);
this.addSubCommand(this.cmdFactionsAccessPlayer);
this.addSubCommand(this.cmdFactionsAccessFaction);
// Aliases
this.addAliases("access");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqIsPlayer.get());
this.addRequirements(ReqHasPerm.get(Perm.ACCESS.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
HelpCommand.get().execute(this.sender, this.args, this.commandChain);
}
}

View File

@@ -17,16 +17,29 @@ import com.massivecraft.mcore.util.Txt;
public abstract class CmdFactionsAccessAbstract extends FCommand
{
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
public PS chunk;
public TerritoryAccess ta;
public Faction hostFaction;
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsAccessAbstract()
{
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqIsPlayer.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
{
@@ -58,4 +71,5 @@ public abstract class CmdFactionsAccessAbstract extends FCommand
}
return Txt.implodeCommaAnd(descriptions, Txt.parse("<i>, "), Txt.parse(" <i>and "));
}
}

View File

@@ -10,16 +10,27 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsAccessFaction()
{
// Aliases
this.addAliases("f", "faction");
// Args
this.addRequiredArg("faction");
this.addOptionalArg("yes/no", "toggle");
// Requirements
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_FACTION.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void innerPerform()
{
@@ -40,4 +51,5 @@ public class CmdFactionsAccessFaction extends CmdFactionsAccessAbstract
// Inform
this.sendAccessInfo();
}
}

View File

@@ -10,16 +10,27 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsAccessPlayer()
{
// Aliases
this.addAliases("p", "player");
// Args
this.addRequiredArg("player");
this.addOptionalArg("yes/no", "toggle");
// Requirements
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_PLAYER.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void innerPerform()
{
@@ -40,4 +51,5 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract
// Inform
this.sendAccessInfo();
}
}

View File

@@ -3,19 +3,29 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsAccessView extends CmdFactionsAccessAbstract
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsAccessView()
{
// Aliases
this.addAliases("v", "view");
// Requirements
this.addRequirements(ReqHasPerm.get(Perm.ACCESS_VIEW.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void innerPerform()
{
this.sendAccessInfo();
}
}

View File

@@ -7,15 +7,26 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsAdmin extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsAdmin()
{
// Aliases
this.addAliases("admin");
// Args
this.addOptionalArg("on/off", "flip");
//this.addRequirements(ReqFactionsEnabled.get());
// Requirements
// this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.ADMIN.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -36,4 +47,5 @@ public class CmdFactionsAdmin extends FCommand
Factions.get().log(msender.getId() + " DISABLED admin bypass mode.");
}
}
}

View File

@@ -12,17 +12,28 @@ import com.massivecraft.mcore.ps.PS;
public class CmdFactionsAutoClaim extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsAutoClaim()
{
// Aliases
this.addAliases("autoclaim");
// Args
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.AUTOCLAIM.node));
this.addRequirements(ReqIsPlayer.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
{

View File

@@ -15,18 +15,28 @@ import com.massivecraft.mcore.ps.PS;
public class CmdFactionsClaim extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsClaim()
{
// Aliases
this.addAliases("claim");
// Args
this.addOptionalArg("radius", "1");
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqIsPlayer.get());
this.addRequirements(ReqHasPerm.get(Perm.CLAIM.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -98,4 +108,5 @@ public class CmdFactionsClaim extends FCommand
};
}
}

View File

@@ -21,20 +21,31 @@ import com.massivecraft.mcore.store.MStore;
public class CmdFactionsCreate extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsCreate()
{
// Aliases
this.addAliases("create");
// Args
this.addRequiredArg("name");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasntFaction.get());
this.addRequirements(ReqHasPerm.get(Perm.CREATE.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
{
{
// Args
String newName = this.arg(0);

View File

@@ -9,13 +9,19 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsDemote extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsDemote()
{
// Aliases
this.addAliases("demote");
// Args
this.addRequiredArg("player");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.DEMOTE.node));
@@ -23,6 +29,10 @@ public class CmdFactionsDemote extends FCommand
//To demote someone from officer -> member you must be a leader.
//We'll handle this internally
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -11,18 +11,29 @@ import com.massivecraft.mcore.mixin.Mixin;
public class CmdFactionsDescription extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsDescription()
{
// Aliases
this.addAliases("desc");
// Args
this.addRequiredArg("desc");
this.setErrorOnToManyArgs(false);
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.DESCRIPTION.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -19,15 +19,26 @@ import com.massivecraft.mcore.util.Txt;
public class CmdFactionsDisband extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsDisband()
{
// Aliases
this.addAliases("disband");
// Args
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.DISBAND.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -81,4 +92,5 @@ public class CmdFactionsDisband extends FCommand
faction.detach();
}
}

View File

@@ -26,16 +26,27 @@ import com.massivecraft.mcore.util.Txt;
public class CmdFactionsFaction extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsFaction()
{
// Aliases
this.addAliases("f", "faction");
// Args
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.FACTION.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
{

View File

@@ -12,18 +12,28 @@ import com.massivecraft.mcore.util.Txt;
public class CmdFactionsFlag extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsFlag()
{
// Aliases
this.addAliases("flag");
// Args
this.addOptionalArg("faction", "you");
this.addOptionalArg("flag", "all");
this.addOptionalArg("yes/no", "read");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.FLAG.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -24,15 +24,25 @@ import com.massivecraft.mcore.ps.PS;
public class CmdFactionsHome extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsHome()
{
// Aliases
this.addAliases("home");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.HOME.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqIsPlayer.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -14,18 +14,29 @@ import com.massivecraft.mcore.cmd.req.ReqIsPlayer;
public class CmdFactionsInvite extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsInvite()
{
// Aliases
this.addAliases("inv", "invite");
// Args
this.addRequiredArg("player");
this.addOptionalArg("yes/no", "toggle");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.INVITE.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqIsPlayer.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -16,16 +16,27 @@ import com.massivecraft.mcore.util.Txt;
public class CmdFactionsJoin extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsJoin()
{
// Aliases
this.addAliases("join");
// Args
this.addRequiredArg("faction");
this.addOptionalArg("player", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.JOIN.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -113,4 +124,5 @@ public class CmdFactionsJoin extends FCommand
}
}
}
}

View File

@@ -17,16 +17,26 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsKick extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsKick()
{
// Aliases
this.addAliases("kick");
// Args
this.addRequiredArg("player");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.KICK.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -15,17 +15,27 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.Txt;
public class CmdFactionsLeader extends FCommand
{
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsLeader()
{
// Aliases
this.addAliases("leader");
// Args
this.addRequiredArg("player");
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.LEADER.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -97,4 +107,5 @@ public class CmdFactionsLeader extends FCommand
uplayer.msg("%s<i> gave %s<i> the leadership of %s<i>.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(usender, uplayer, true), newLeader.describeTo(uplayer), targetFaction.describeTo(uplayer));
}
}
}

View File

@@ -5,16 +5,26 @@ import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsLeave extends FCommand {
public class CmdFactionsLeave extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsLeave()
{
// Aliases
this.addAliases("leave");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.LEAVE.node));
this.addRequirements(ReqHasFaction.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -15,16 +15,27 @@ import com.massivecraft.mcore.util.Txt;
public class CmdFactionsList extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsList()
{
// Aliases
this.addAliases("l", "list");
// Args
this.addOptionalArg("page", "1");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.LIST.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
{
@@ -69,4 +80,5 @@ public class CmdFactionsList extends FCommand
sendMessage(lines);
}
}

View File

@@ -10,16 +10,27 @@ import com.massivecraft.mcore.ps.PS;
public class CmdFactionsMap extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsMap()
{
// Aliases
this.addAliases("map");
// Args
this.addOptionalArg("on/off", "once");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MAP.node));
this.addRequirements(ReqIsPlayer.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -3,11 +3,14 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsMoney extends FCommand
{
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
public CmdFactionsMoneyBalance cmdMoneyBalance = new CmdFactionsMoneyBalance();
public CmdFactionsMoneyDeposit cmdMoneyDeposit = new CmdFactionsMoneyDeposit();
public CmdFactionsMoneyWithdraw cmdMoneyWithdraw = new CmdFactionsMoneyWithdraw();
@@ -15,27 +18,27 @@ public class CmdFactionsMoney extends FCommand
public CmdFactionsMoneyTransferFp cmdMoneyTransferFp = new CmdFactionsMoneyTransferFp();
public CmdFactionsMoneyTransferPf cmdMoneyTransferPf = new CmdFactionsMoneyTransferPf();
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsMoney()
{
this.addAliases("money");
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqBankCommandsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY.node));
// Add SubCommands
this.addSubCommand(this.cmdMoneyBalance);
this.addSubCommand(this.cmdMoneyDeposit);
this.addSubCommand(this.cmdMoneyWithdraw);
this.addSubCommand(this.cmdMoneyTransferFf);
this.addSubCommand(this.cmdMoneyTransferFp);
this.addSubCommand(this.cmdMoneyTransferPf);
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
// Aliases
this.addAliases("money");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqBankCommandsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY.node));
}
}

View File

@@ -10,16 +10,27 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsMoneyBalance extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsMoneyBalance()
{
// Aliases
this.addAliases("b", "balance");
// Args
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY_BALANCE.node));
this.addRequirements(ReqBankCommandsEnabled.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -15,20 +15,30 @@ import com.massivecraft.mcore.util.Txt;
import org.bukkit.ChatColor;
public class CmdFactionsMoneyDeposit extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsMoneyDeposit()
{
// Aliases
this.addAliases("d", "deposit");
// Args
this.addRequiredArg("amount");
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY_DEPOSIT.node));
this.addRequirements(ReqBankCommandsEnabled.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -18,18 +18,29 @@ import org.bukkit.ChatColor;
public class CmdFactionsMoneyTransferFf extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsMoneyTransferFf()
{
// Aliases
this.addAliases("ff");
// Args
this.addRequiredArg("amount");
this.addRequiredArg("faction");
this.addRequiredArg("faction");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2F.node));
this.addRequirements(ReqBankCommandsEnabled.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -50,4 +61,5 @@ public class CmdFactionsMoneyTransferFf extends FCommand
Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the faction \"%s\" to the faction \"%s\"", usender.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null))));
}
}
}

View File

@@ -20,19 +20,30 @@ import org.bukkit.ChatColor;
public class CmdFactionsMoneyTransferFp extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsMoneyTransferFp()
{
// Aliases
this.addAliases("fp");
// Args
this.addRequiredArg("amount");
this.addRequiredArg("faction");
this.addRequiredArg("player");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY_F2P.node));
this.addRequirements(ReqBankCommandsEnabled.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
{
@@ -52,4 +63,5 @@ public class CmdFactionsMoneyTransferFp extends FCommand
Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the faction \"%s\" to the player \"%s\"", usender.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null))));
}
}
}

View File

@@ -20,18 +20,29 @@ import org.bukkit.ChatColor;
public class CmdFactionsMoneyTransferPf extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsMoneyTransferPf()
{
// Aliases
this.addAliases("pf");
// Args
this.addRequiredArg("amount");
this.addRequiredArg("player");
this.addRequiredArg("faction");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY_P2F.node));
this.addRequirements(ReqBankCommandsEnabled.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -52,4 +63,5 @@ public class CmdFactionsMoneyTransferPf extends FCommand
Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the player \"%s\" to the faction \"%s\"", usender.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null))));
}
}
}

View File

@@ -19,17 +19,28 @@ import org.bukkit.ChatColor;
public class CmdFactionsMoneyWithdraw extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsMoneyWithdraw()
{
// Aliases
this.addAliases("w", "withdraw");
// Args
this.addRequiredArg("amount");
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.MONEY_WITHDRAW.node));
this.addRequirements(ReqBankCommandsEnabled.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -49,4 +60,5 @@ public class CmdFactionsMoneyWithdraw extends FCommand
Factions.get().log(ChatColor.stripColor(Txt.parse("%s withdrew %s from the faction bank: %s", usender.getName(), Money.format(from, amount), from.describeTo(null))));
}
}
}

View File

@@ -16,17 +16,28 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsName extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsName()
{
// Aliases
this.addAliases("name");
// Args
this.addRequiredArg("new name");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.NAME.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -10,15 +10,26 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsOfficer extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsOfficer()
{
// Aliases
this.addAliases("officer");
// Args
this.addRequiredArg("player");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.OFFICER.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -11,17 +11,28 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsOpen extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsOpen()
{
// Aliases
this.addAliases("open");
// Args
this.addOptionalArg("yes/no", "toggle");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.OPEN.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -14,19 +14,30 @@ import com.massivecraft.mcore.util.Txt;
public class CmdFactionsPerm extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsPerm()
{
// Aliases
this.addAliases("perm");
// Args
this.addOptionalArg("faction", "you");
this.addOptionalArg("perm", "all");
this.addOptionalArg("relation", "read");
this.addOptionalArg("yes/no", "read");
this.setErrorOnToManyArgs(false);
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.PERM.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -14,15 +14,26 @@ import com.massivecraft.mcore.util.Txt;
public class CmdFactionsPlayer extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsPlayer()
{
// Aliases
this.addAliases("p", "player");
// Args
this.addOptionalArg("player", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -70,4 +81,5 @@ public class CmdFactionsPlayer extends FCommand
msg("<k>Power per Death: <v>%.2f", uplayer.getPowerPerDeath());
}
}

View File

@@ -12,17 +12,28 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsPowerBoost extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsPowerBoost()
{
// Aliases
this.addAliases("powerboost");
// Args
this.addRequiredArg("p|f|player|faction");
this.addRequiredArg("name");
this.addRequiredArg("#");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.POWERBOOST.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -65,4 +76,5 @@ public class CmdFactionsPowerBoost extends FCommand
msg("<i>"+target+" now has a power bonus/penalty of "+targetPower+" to min and max power levels.");
Factions.get().log(usender.getName()+" has set the power bonus/penalty for "+target+" to "+targetPower+".");
}
}

View File

@@ -9,12 +9,19 @@ import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsPromote extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsPromote()
{
// Aliases
this.addAliases("promote");
// Args
this.addRequiredArg("player");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.PROMOTE.node));
@@ -22,6 +29,10 @@ public class CmdFactionsPromote extends FCommand
//To promote someone from member -> officer you must be a leader.
//We'll handle this internally
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -1,6 +1,5 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FFlag;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel;
@@ -9,22 +8,33 @@ import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.event.FactionsEventRelationChange;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public abstract class CmdFactionsRelationAbstract extends FCommand
{
public Rel targetRelation;
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsRelationAbstract()
{
// Aliases
this.addRequiredArg("faction");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.RELATION.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()
@@ -75,7 +85,7 @@ public abstract class CmdFactionsRelationAbstract extends FCommand
else
{
otherFaction.msg("%s<i> wishes to be %s.", usenderFaction.describeTo(otherFaction, true), newRelation.getColor()+newRelation.getDescFactionOne());
otherFaction.msg("<i>Type <c>/"+ConfServer.baseCommandAliases.get(0)+" "+newRelation+" "+usenderFaction.getName()+"<i> to accept.");
otherFaction.msg("<i>Type <c>/"+MConf.get().aliasesF.get(0)+" "+newRelation+" "+usenderFaction.getName()+"<i> to accept.");
usenderFaction.msg("%s<i> were informed that you wish to be %s<i>.", otherFaction.describeTo(usenderFaction, true), newRelation.getColor()+newRelation.getDescFactionOne());
}
@@ -93,4 +103,5 @@ public abstract class CmdFactionsRelationAbstract extends FCommand
usenderFaction.msg("<i>This will have no effect while your faction is peaceful.");
}
}
}

View File

@@ -4,10 +4,17 @@ import com.massivecraft.factions.Rel;
public class CmdFactionsRelationAlly extends CmdFactionsRelationAbstract
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsRelationAlly()
{
// Aliases
this.addAliases("ally");
// Misc
this.targetRelation = Rel.ALLY;
}
}

View File

@@ -4,10 +4,17 @@ import com.massivecraft.factions.Rel;
public class CmdFactionsRelationEnemy extends CmdFactionsRelationAbstract
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsRelationEnemy()
{
// Aliases
this.addAliases("enemy");
// Misc
this.targetRelation = Rel.ENEMY;
}
}

View File

@@ -4,10 +4,17 @@ import com.massivecraft.factions.Rel;
public class CmdFactionsRelationNeutral extends CmdFactionsRelationAbstract
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsRelationNeutral()
{
// Aliases
this.addAliases("neutral");
// Misc
this.targetRelation = Rel.NEUTRAL;
}
}

View File

@@ -4,10 +4,17 @@ import com.massivecraft.factions.Rel;
public class CmdFactionsRelationTruce extends CmdFactionsRelationAbstract
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsRelationTruce()
{
// Aliases
this.addAliases("truce");
// Misc
this.targetRelation = Rel.TRUCE;
}
}

View File

@@ -14,14 +14,24 @@ import com.massivecraft.mcore.ps.PSFormatHumanSpace;
public class CmdFactionsSeeChunk extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsSeeChunk()
{
// Aliases
this.addAliases("sc", "seechunk");
//this.addRequirements(ReqFactionsEnabled.get());
// Requirements
// this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.SEE_CHUNK.node));
this.addRequirements(ReqIsPlayer.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -14,16 +14,27 @@ import com.massivecraft.mcore.ps.PS;
public class CmdFactionsSethome extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsSethome()
{
// Aliases
this.addAliases("sethome");
// Args
this.addOptionalArg("faction", "you");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqIsPlayer.get());
this.addRequirements(ReqHasPerm.get(Perm.SETHOME.node));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -15,17 +15,28 @@ import com.massivecraft.mcore.util.Txt;
public class CmdFactionsTitle extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsTitle()
{
// Aliases
this.addAliases("title");
// Args
this.addRequiredArg("player");
this.addOptionalArg("title", "");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.TITLE.node));
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -11,15 +11,25 @@ import com.massivecraft.mcore.ps.PS;
public class CmdFactionsUnclaim extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsUnclaim()
{
// Aliases
this.addAliases("unclaim");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqIsPlayer.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -20,15 +20,25 @@ import com.massivecraft.mcore.ps.PS;
public class CmdFactionsUnclaimall extends FCommand
{
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsUnclaimall()
{
// Aliases
this.addAliases("unclaimall");
// Requirements
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM_ALL.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void perform()

View File

@@ -10,10 +10,18 @@ import com.massivecraft.mcore.util.Txt;
public abstract class FCommand extends MCommand
{
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
public MPlayer msender;
public UPlayer usender;
public Faction usenderFaction;
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public void fixSenderVars()
{
@@ -68,4 +76,5 @@ public abstract class FCommand extends MCommand
return false;
}
}