2011-07-18 22:06:02 +02:00
|
|
|
package com.massivecraft.factions.commands;
|
2011-03-22 15:45:41 +01:00
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
import org.bukkit.command.CommandSender;
|
2011-07-18 22:06:02 +02:00
|
|
|
|
|
|
|
import com.massivecraft.factions.Conf;
|
2011-10-05 12:13:54 +02:00
|
|
|
import com.massivecraft.factions.integration.Econ;
|
2011-07-18 22:06:02 +02:00
|
|
|
import com.massivecraft.factions.util.TextUtil;
|
2011-03-23 17:39:56 +01:00
|
|
|
|
2011-03-22 15:45:41 +01:00
|
|
|
|
|
|
|
public class FCommandHelp extends FBaseCommand {
|
|
|
|
|
|
|
|
public FCommandHelp() {
|
2011-03-22 18:48:09 +01:00
|
|
|
aliases.add("help");
|
|
|
|
aliases.add("h");
|
|
|
|
aliases.add("?");
|
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
optionalParameters.add("page");
|
2011-03-22 15:45:41 +01:00
|
|
|
|
|
|
|
helpDescription = "Display a help page";
|
|
|
|
}
|
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
@Override
|
|
|
|
public boolean hasPermission(CommandSender sender) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-06-21 07:38:31 +02:00
|
|
|
@Override
|
2011-03-22 15:45:41 +01:00
|
|
|
public void perform() {
|
|
|
|
int page = 1;
|
|
|
|
if (parameters.size() > 0) {
|
|
|
|
try {
|
|
|
|
page = Integer.parseInt(parameters.get(0));
|
|
|
|
} catch (NumberFormatException e) {
|
|
|
|
// wasn't an integer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sendMessage(TextUtil.titleize("Factions Help ("+page+"/"+helpPages.size()+")"));
|
|
|
|
page -= 1;
|
|
|
|
if (page < 0 || page >= helpPages.size()) {
|
|
|
|
sendMessage("This page does not exist");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
sendMessage(helpPages.get(page));
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------//
|
|
|
|
// Build the help pages
|
|
|
|
//----------------------------------------------//
|
|
|
|
|
Some tweaking of the faction bank code...
The new help page with bank related commands will now only be shown if banks are enabled and the Economy is enabled and hooked in.
Shortened a couple of command descriptions to fit on one line.
Made Deposit, Pay, and Withdraw commands additionally log to the server console/log.
When bank is given to person disbanding a faction, it now lets them know and logs it to the server log.
Added commands to commandDisable list in plugin.yml, along with "permanent" command which I'd missed adding before
Added new permission node factions.viewAnyFactionBalance (granted by default if using superperms), which is required to view the bank balance of other factions
For reference, about the faction bank addition as a whole...
New conf.json settings:
"bankEnabled": true, - enable faction banks
"bankMembersCanWithdraw": false, - have to be at least moderator to withdraw or pay money to another faction, unless this is set to true
"bankFactionPaysCosts": true, - if true, payments for faction command costs are charged to faction bank
"bankFactionPaysLandCosts": true, - if true, payments for land claims are charged to faction bank
New commands:
/f balance *<faction tag> - Shows the bank balance of a specified faction (if permission checks out), or the player's faction if none is specified
/f deposit <amount> - Deposit money into your faction's bank
/f pay <faction tag> <amount> - Pay money from your faction bank to another faction (requires moderator or admin status)
/f withdraw <amount> - Withdraw money from your faction's bank (requires moderator or admin status, unless "bankMembersCanWithdraw" is set to true)
New permission node:
factions.viewAnyFactionBalance - Allows the player to view the faction bank balance of all factions (default)
2011-10-01 12:59:09 +02:00
|
|
|
public static ArrayList<ArrayList<String>> helpPages;
|
2011-03-22 15:45:41 +01:00
|
|
|
|
Some tweaking of the faction bank code...
The new help page with bank related commands will now only be shown if banks are enabled and the Economy is enabled and hooked in.
Shortened a couple of command descriptions to fit on one line.
Made Deposit, Pay, and Withdraw commands additionally log to the server console/log.
When bank is given to person disbanding a faction, it now lets them know and logs it to the server log.
Added commands to commandDisable list in plugin.yml, along with "permanent" command which I'd missed adding before
Added new permission node factions.viewAnyFactionBalance (granted by default if using superperms), which is required to view the bank balance of other factions
For reference, about the faction bank addition as a whole...
New conf.json settings:
"bankEnabled": true, - enable faction banks
"bankMembersCanWithdraw": false, - have to be at least moderator to withdraw or pay money to another faction, unless this is set to true
"bankFactionPaysCosts": true, - if true, payments for faction command costs are charged to faction bank
"bankFactionPaysLandCosts": true, - if true, payments for land claims are charged to faction bank
New commands:
/f balance *<faction tag> - Shows the bank balance of a specified faction (if permission checks out), or the player's faction if none is specified
/f deposit <amount> - Deposit money into your faction's bank
/f pay <faction tag> <amount> - Pay money from your faction bank to another faction (requires moderator or admin status)
/f withdraw <amount> - Withdraw money from your faction's bank (requires moderator or admin status, unless "bankMembersCanWithdraw" is set to true)
New permission node:
factions.viewAnyFactionBalance - Allows the player to view the faction bank balance of all factions (default)
2011-10-01 12:59:09 +02:00
|
|
|
public static void updateHelp() {
|
2011-03-22 15:45:41 +01:00
|
|
|
helpPages = new ArrayList<ArrayList<String>>();
|
|
|
|
ArrayList<String> pageLines;
|
|
|
|
|
|
|
|
pageLines = new ArrayList<String>();
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandHelp().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandList().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandShow().getUseageTemplate() );
|
2011-07-25 20:16:14 +02:00
|
|
|
pageLines.add( new FCommandPower().getUseageTemplate() );
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandJoin().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandLeave().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandChat().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandHome().getUseageTemplate() );
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines.add( "Learn how to create a faction on the next page." );
|
2011-03-22 15:45:41 +01:00
|
|
|
helpPages.add(pageLines);
|
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines = new ArrayList<String>();
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandCreate().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandDescription().getUseageTemplate() );
|
2011-06-10 21:26:12 +02:00
|
|
|
pageLines.add( new FCommandTag().getUseageTemplate() );
|
2011-06-03 20:00:16 +02:00
|
|
|
pageLines.add( "You might want to close it and use invitations:" );
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandOpen().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandInvite().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandDeinvite().getUseageTemplate() );
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines.add( "And don't forget to set your home:" );
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandSethome().getUseageTemplate() );
|
2011-03-23 17:39:56 +01:00
|
|
|
helpPages.add(pageLines);
|
|
|
|
|
Some tweaking of the faction bank code...
The new help page with bank related commands will now only be shown if banks are enabled and the Economy is enabled and hooked in.
Shortened a couple of command descriptions to fit on one line.
Made Deposit, Pay, and Withdraw commands additionally log to the server console/log.
When bank is given to person disbanding a faction, it now lets them know and logs it to the server log.
Added commands to commandDisable list in plugin.yml, along with "permanent" command which I'd missed adding before
Added new permission node factions.viewAnyFactionBalance (granted by default if using superperms), which is required to view the bank balance of other factions
For reference, about the faction bank addition as a whole...
New conf.json settings:
"bankEnabled": true, - enable faction banks
"bankMembersCanWithdraw": false, - have to be at least moderator to withdraw or pay money to another faction, unless this is set to true
"bankFactionPaysCosts": true, - if true, payments for faction command costs are charged to faction bank
"bankFactionPaysLandCosts": true, - if true, payments for land claims are charged to faction bank
New commands:
/f balance *<faction tag> - Shows the bank balance of a specified faction (if permission checks out), or the player's faction if none is specified
/f deposit <amount> - Deposit money into your faction's bank
/f pay <faction tag> <amount> - Pay money from your faction bank to another faction (requires moderator or admin status)
/f withdraw <amount> - Withdraw money from your faction's bank (requires moderator or admin status, unless "bankMembersCanWithdraw" is set to true)
New permission node:
factions.viewAnyFactionBalance - Allows the player to view the faction bank balance of all factions (default)
2011-10-01 12:59:09 +02:00
|
|
|
if (Econ.enabled() && Conf.bankEnabled) {
|
|
|
|
pageLines = new ArrayList<String>();
|
|
|
|
pageLines.add( "" );
|
|
|
|
pageLines.add( "Your faction has a bank which is used to pay for certain" );
|
|
|
|
pageLines.add( "things, so it will need to have money deposited into it." );
|
|
|
|
pageLines.add( "" );
|
|
|
|
pageLines.add( new FCommandBalance().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandDeposit().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandWithdraw().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandPay().getUseageTemplate() );
|
|
|
|
pageLines.add( "" );
|
|
|
|
helpPages.add(pageLines);
|
|
|
|
}
|
2011-09-24 03:22:53 +02:00
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines = new ArrayList<String>();
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandClaim().getUseageTemplate() );
|
2011-06-10 21:26:12 +02:00
|
|
|
pageLines.add( new FCommandAutoClaim().getUseageTemplate() );
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandUnclaim().getUseageTemplate() );
|
2011-04-08 16:22:00 +02:00
|
|
|
pageLines.add( new FCommandUnclaimall().getUseageTemplate() );
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandKick().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandMod().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandAdmin().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandTitle().getUseageTemplate() );
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines.add( "Player titles are just for fun. No rules connected to them." );
|
2011-03-22 15:45:41 +01:00
|
|
|
helpPages.add(pageLines);
|
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines = new ArrayList<String>();
|
2011-07-25 20:16:14 +02:00
|
|
|
pageLines.add( new FCommandMap().getUseageTemplate() );
|
2011-08-05 10:50:47 +02:00
|
|
|
pageLines.add( new FCommandNoBoom().getUseageTemplate() );
|
Faction admins can now mark already claimed areas as owned by specific faction members. Ownership can include multiple members. New command /f owner *[player name], to set/remove ownership. This command is only available to the faction admin and optionally the faction moderators. If no player name is specified, it will either set ownership to the player running the command (if no owner is currently set) or completely clear ownership of the territory. New command /f ownerlist, to view a list of owners for the current area. Only works inside your own faction's territory. New conf.json options "ownedAreasEnabled", "ownedAreasModeratorsCanSet", "ownedAreaModeratorsBypass", "ownedAreaDenyBuild", "ownedAreaProtectMaterials", and "ownedAreaDenyUseage" (all defaulting to true) to determine whether faction moderators can set or bypass ownership (faction admin always can), and what sort of protection these owned areas have against normal members of the faction (members other than the owner(s), faction admin, and probably faction moderators). New conf.json option "ownedAreasLimitPerFaction" to limit how many owned areas can be set. New permission node "factions.ownershipBypass" which allows a player to bypass ownership protection, but only within the person's own faction.
various little tweaks and improvements to other code
moderate speed boost to FLocation code
made commandDisable permissions work for any command alias of a command, instead of just the first one
2011-07-31 03:17:00 +02:00
|
|
|
pageLines.add("");
|
|
|
|
pageLines.add( new FCommandOwner().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandOwnerList().getUseageTemplate() );
|
|
|
|
pageLines.add("");
|
|
|
|
pageLines.add("Claimed land with ownership set is further protected so");
|
|
|
|
pageLines.add("that only the owner(s), faction admin, and possibly the");
|
|
|
|
pageLines.add("faction moderators have full access.");
|
|
|
|
helpPages.add(pageLines);
|
|
|
|
|
|
|
|
pageLines = new ArrayList<String>();
|
2011-09-13 05:36:59 +02:00
|
|
|
pageLines.add( new FCommandDisband().getUseageTemplate() );
|
|
|
|
pageLines.add("");
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandRelationAlly().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandRelationNeutral().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandRelationEnemy().getUseageTemplate() );
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines.add("Set the relation you WISH to have with another faction.");
|
|
|
|
pageLines.add("Your default relation with other factions will be neutral.");
|
|
|
|
pageLines.add("If BOTH factions choose \"ally\" you will be allies.");
|
|
|
|
pageLines.add("If ONE faction chooses \"enemy\" you will be enemies.");
|
2011-03-22 15:45:41 +01:00
|
|
|
helpPages.add(pageLines);
|
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines = new ArrayList<String>();
|
|
|
|
pageLines.add("You can never hurt members or allies.");
|
|
|
|
pageLines.add("You can not hurt neutrals in their own territory.");
|
|
|
|
pageLines.add("You can always hurt enemies and players without faction.");
|
2011-03-22 15:45:41 +01:00
|
|
|
pageLines.add("");
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines.add("Damage from enemies is reduced in your own territory.");
|
|
|
|
pageLines.add("When you die you lose power. It is restored over time.");
|
|
|
|
pageLines.add("The power of a faction is the sum of all member power.");
|
|
|
|
pageLines.add("The power of a faction determines how much land it can hold.");
|
|
|
|
pageLines.add("You can claim land from factions with too little power.");
|
2011-03-22 15:45:41 +01:00
|
|
|
helpPages.add(pageLines);
|
|
|
|
|
|
|
|
pageLines = new ArrayList<String>();
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines.add("Only faction members can build and destroy in their own");
|
|
|
|
pageLines.add("territory. Usage of the following items is also restricted:");
|
2011-07-25 00:38:58 +02:00
|
|
|
pageLines.add("Door, Chest, Furnace, Dispenser, Diode.");
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines.add("");
|
|
|
|
pageLines.add("Make sure to put pressure plates in front of doors for your");
|
|
|
|
pageLines.add("guest visitors. Otherwise they can't get through. You can");
|
|
|
|
pageLines.add("also use this to create member only areas.");
|
|
|
|
pageLines.add("As dispensers are protected, you can create traps without");
|
|
|
|
pageLines.add("worrying about those arrows getting stolen.");
|
|
|
|
helpPages.add(pageLines);
|
2011-03-22 15:45:41 +01:00
|
|
|
|
2011-03-23 17:39:56 +01:00
|
|
|
pageLines = new ArrayList<String>();
|
|
|
|
pageLines.add("Finally some commands for the server admins:");
|
2011-09-13 20:14:09 +02:00
|
|
|
pageLines.add( new FCommandBypass().getUseageTemplate() );
|
2011-04-08 16:03:04 +02:00
|
|
|
pageLines.add( new FCommandSafeclaim().getUseageTemplate() );
|
2011-06-10 21:26:12 +02:00
|
|
|
pageLines.add( new FCommandAutoSafeclaim().getUseageTemplate() );
|
2011-05-29 23:28:29 +02:00
|
|
|
pageLines.add( new FCommandSafeunclaimall().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandWarclaim().getUseageTemplate() );
|
2011-06-10 21:26:12 +02:00
|
|
|
pageLines.add( new FCommandAutoWarclaim().getUseageTemplate() );
|
2011-05-29 23:28:29 +02:00
|
|
|
pageLines.add( new FCommandWarunclaimall().getUseageTemplate() );
|
2011-06-21 07:38:31 +02:00
|
|
|
pageLines.add("Note: " + Conf.colorCommand + "f unclaim" + Conf.colorSystem + " works on safe/war zones as well.");
|
2011-03-22 15:45:41 +01:00
|
|
|
helpPages.add(pageLines);
|
2011-05-29 23:28:29 +02:00
|
|
|
|
|
|
|
pageLines = new ArrayList<String>();
|
|
|
|
pageLines.add("More commands for server admins:");
|
2011-08-05 10:50:47 +02:00
|
|
|
pageLines.add( new FCommandPeaceful().getUseageTemplate() );
|
2011-09-13 20:14:09 +02:00
|
|
|
pageLines.add( new FCommandPermanent().getUseageTemplate() );
|
2011-08-05 10:50:47 +02:00
|
|
|
pageLines.add("Peaceful factions are protected from PvP and land capture.");
|
2011-05-29 23:28:29 +02:00
|
|
|
pageLines.add( new FCommandLock().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandReload().getUseageTemplate() );
|
|
|
|
pageLines.add( new FCommandSaveAll().getUseageTemplate() );
|
2011-06-16 09:34:56 +02:00
|
|
|
pageLines.add( new FCommandVersion().getUseageTemplate() );
|
2011-07-22 14:25:12 +02:00
|
|
|
pageLines.add( new FCommandConfig().getUseageTemplate() );
|
2011-05-29 23:28:29 +02:00
|
|
|
helpPages.add(pageLines);
|
2011-03-22 15:45:41 +01:00
|
|
|
}
|
Some tweaking of the faction bank code...
The new help page with bank related commands will now only be shown if banks are enabled and the Economy is enabled and hooked in.
Shortened a couple of command descriptions to fit on one line.
Made Deposit, Pay, and Withdraw commands additionally log to the server console/log.
When bank is given to person disbanding a faction, it now lets them know and logs it to the server log.
Added commands to commandDisable list in plugin.yml, along with "permanent" command which I'd missed adding before
Added new permission node factions.viewAnyFactionBalance (granted by default if using superperms), which is required to view the bank balance of other factions
For reference, about the faction bank addition as a whole...
New conf.json settings:
"bankEnabled": true, - enable faction banks
"bankMembersCanWithdraw": false, - have to be at least moderator to withdraw or pay money to another faction, unless this is set to true
"bankFactionPaysCosts": true, - if true, payments for faction command costs are charged to faction bank
"bankFactionPaysLandCosts": true, - if true, payments for land claims are charged to faction bank
New commands:
/f balance *<faction tag> - Shows the bank balance of a specified faction (if permission checks out), or the player's faction if none is specified
/f deposit <amount> - Deposit money into your faction's bank
/f pay <faction tag> <amount> - Pay money from your faction bank to another faction (requires moderator or admin status)
/f withdraw <amount> - Withdraw money from your faction's bank (requires moderator or admin status, unless "bankMembersCanWithdraw" is set to true)
New permission node:
factions.viewAnyFactionBalance - Allows the player to view the faction bank balance of all factions (default)
2011-10-01 12:59:09 +02:00
|
|
|
|
|
|
|
static {
|
|
|
|
updateHelp();
|
|
|
|
}
|
2011-03-22 15:45:41 +01:00
|
|
|
}
|
|
|
|
|