Fixes #419 , among other things

This commit is contained in:
boy0001
2015-07-17 20:48:13 +10:00
parent 1564b58a3d
commit b2fbd74d4b
15 changed files with 226 additions and 141 deletions

View File

@ -68,11 +68,9 @@ public class DebugExec extends SubCommand {
@Override
public void run() {
List<Double> result = new ArrayList<>();
result.add(Math.round(value.air * 100) / 100d);
result.add(Math.round(value.changes * 100) / 100d);
result.add(Math.round(value.complexity * 100) / 100d);
result.add(Math.round(value.data * 100) / 100d);
result.add(Math.round(value.faces * 100) / 100d);
result.add(Math.round(value.data * 100) / 100d);
result.add(Math.round(value.air * 100) / 100d);
result.add(Math.round(value.variety * 100) / 100d);
Flag flag = new Flag(FlagManager.getFlag("analysis"), result);

View File

@ -88,7 +88,7 @@ public class MainCommand {
final int start = page * perPage;
for (int x = start; x < max; x++) {
cmd = commands.get(x);
String s = t(C.HELP_ITEM.s());
String s = C.HELP_ITEM.s();
if (cmd.alias.size() > 0) {
s = s.replace("%alias%", cmd.alias.get(0));
}
@ -99,14 +99,10 @@ public class MainCommand {
help.add(s);
}
if (help.size() < 2) {
help.add(t(C.NO_COMMANDS.s()));
help.add(C.NO_COMMANDS.s());
}
return help;
}
private static String t(final String s) {
return MainUtil.colorise('&', s);
}
public static boolean onCommand(final PlotPlayer player, final String cmd, final String... args) {
if ((args.length < 1) || ((args.length >= 1) && (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("he")))) {

View File

@ -225,6 +225,7 @@ public class Set extends SubCommand {
if (component.equalsIgnoreCase(args[0])) {
if (!Permissions.hasPermission(plr, "plots.set." + component)) {
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.set." + component);
return false;
}
PlotBlock[] blocks;
try {
@ -313,7 +314,7 @@ public class Set extends SubCommand {
}
private String getString(final String s) {
return MainUtil.colorise('&', C.BLOCK_LIST_ITEM.s().replaceAll("%mat%", s));
return StringMan.replaceAll(C.BLOCK_LIST_ITEM.s(), "%mat%", s);
}
private String getArgumentList(final List<String> newValues) {
@ -326,7 +327,7 @@ public class Set extends SubCommand {
private String getBiomeList(final String[] biomes) {
final StringBuilder builder = new StringBuilder();
builder.append(MainUtil.colorise('&', C.NEED_BIOME.s()));
builder.append(C.NEED_BIOME.s());
for (final String b : biomes) {
builder.append(getString(b));
}

View File

@ -523,7 +523,7 @@ public class list extends SubCommand {
final StringBuilder builder = new StringBuilder();
String prefix = "";
for (final String s : strings) {
builder.append(prefix + MainUtil.colorise('&', s));
builder.append(prefix + s);
prefix = " | ";
}
return builder.toString();