Refractoring and Cleanup

Optimized some of the code where possible and removed some magic numbers as well.
This commit is contained in:
Matt
2016-02-13 20:01:18 -05:00
parent a1eec4eb0c
commit fde845e1d8
121 changed files with 5462 additions and 5803 deletions

View File

@ -1,5 +1,10 @@
package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.StringMan;
import com.plotsquared.general.commands.Command;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
@ -11,11 +16,6 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.StringMan;
import com.plotsquared.general.commands.Command;
public class GenerateDocs {
public static void main(final String[] args) {
MainCommand.getInstance().addCommand(new WE_Anywhere());
@ -56,7 +56,7 @@ public class GenerateDocs {
log("#### Description");
log("`" + command.getDescription() + "`");
if (comment.length() > 0) {
if (!comment.isEmpty()) {
log("##### Comments");
log("``` java");
log(comment);
@ -72,7 +72,7 @@ public class GenerateDocs {
}
final Set<String> aliases = command.getAliases();
if (aliases.size() > 0) {
if (!aliases.isEmpty()) {
log("#### Aliases");
log("`" + StringMan.getString(command.getAliases()) + "`");
}
@ -80,7 +80,7 @@ public class GenerateDocs {
log("#### Permissions");
log("##### Primary");
log(" - `" + command.getPermission() + "` ");
if (perms.size() > 0) {
if (!perms.isEmpty()) {
log("");
log("##### Other");
log(" - `" + StringMan.join(perms, "`\n - `") + "`");