Reformat before I go crazy.

This commit is contained in:
drtshock
2014-04-04 13:55:21 -05:00
parent 0c3ea377dd
commit 814e439705
124 changed files with 11302 additions and 13164 deletions

View File

@@ -1,48 +1,43 @@
package com.massivecraft.factions.cmd;
import java.util.ArrayList;
import com.massivecraft.factions.P;
import com.massivecraft.factions.zcore.CommandVisibility;
import com.massivecraft.factions.zcore.MCommand;
public class CmdAutoHelp extends MCommand<P>
{
public CmdAutoHelp()
{
super(P.p);
this.aliases.add("?");
this.aliases.add("h");
this.aliases.add("help");
this.setHelpShort("");
this.optionalArgs.put("page","1");
}
@Override
public void perform()
{
if (this.commandChain.size() == 0) return;
MCommand<?> pcmd = this.commandChain.get(this.commandChain.size()-1);
ArrayList<String> lines = new ArrayList<String>();
lines.addAll(pcmd.helpLong);
for(MCommand<?> scmd : pcmd.subCommands)
{
if
(
scmd.visibility == CommandVisibility.VISIBLE
||
(scmd.visibility == CommandVisibility.SECRET && scmd.validSenderPermissions(sender, false))
)
{
lines.add(scmd.getUseageTemplate(this.commandChain, true));
}
}
sendMessage(p.txt.getPage(lines, this.argAsInt(0, 1), "Help for command \""+pcmd.aliases.get(0)+"\""));
}
import java.util.ArrayList;
public class CmdAutoHelp extends MCommand<P> {
public CmdAutoHelp() {
super(P.p);
this.aliases.add("?");
this.aliases.add("h");
this.aliases.add("help");
this.setHelpShort("");
this.optionalArgs.put("page", "1");
}
@Override
public void perform() {
if (this.commandChain.size() == 0) return;
MCommand<?> pcmd = this.commandChain.get(this.commandChain.size() - 1);
ArrayList<String> lines = new ArrayList<String>();
lines.addAll(pcmd.helpLong);
for (MCommand<?> scmd : pcmd.subCommands) {
if
(
scmd.visibility == CommandVisibility.VISIBLE
||
(scmd.visibility == CommandVisibility.SECRET && scmd.validSenderPermissions(sender, false))
) {
lines.add(scmd.getUseageTemplate(this.commandChain, true));
}
}
sendMessage(p.txt.getPage(lines, this.argAsInt(0, 1), "Help for command \"" + pcmd.aliases.get(0) + "\""));
}
}