This commit is contained in:
Jesse Boyd 2016-06-28 20:21:50 +10:00
parent 06682b18a5
commit f4fe762135
4 changed files with 19 additions and 17 deletions

View File

@ -108,7 +108,7 @@ public class ChunkListener implements Listener {
}
Object c = this.methodGetHandleChunk.of(chunk).call();
RefField.RefExecutor field = this.mustSave.of(c);
if (field.get() == true) {
if ((Boolean) field.get() == true) {
field.set(false);
if (chunk.isLoaded()) {
ignoreUnload = true;

View File

@ -122,7 +122,7 @@ public class Visit extends Command {
if (plot.teleportPlayer(player)) {
whenDone.run(Visit.this, CommandResult.SUCCESS);
} else {
whenDone.run(Visit.this, CommandResult.SUCCESS);
whenDone.run(Visit.this, CommandResult.FAILURE);
}
}
}, new Runnable() {

View File

@ -265,7 +265,7 @@ public class StringMan {
return sb.toString();
}
public Collection match(Collection col, String startsWith) {
public <T> Collection<T> match(Collection<T> col, String startsWith) {
if (col == null) {
return null;
}

View File

@ -485,20 +485,22 @@ public abstract class Command {
}
public Collection<Command> tabOf(PlotPlayer player, String[] input, boolean space, String... args) {
/*
<player>
<alias>
<world>
<id>
<#>
*/
// int index = input.length - (space ? 0 : 1);
// List<Command> result = new ArrayList<>();
// for (String arg : args) {
// String[] split = arg.split(" ");
// }
// TODO
return new ArrayList<>();
if (!space) {
return null;
}
List<Command> result = new ArrayList<>();
int index = input.length - (space ? 0 : 1);
for (String arg : args) {
arg = arg.replace(getCommandString() + " ", "");
String[] split = arg.split(" ");
if (split.length <= index) {
continue;
}
arg = StringMan.join(Arrays.copyOfRange(split, index, split.length), " ");
Command cmd = new Command(null, false, arg, getPermission(), getRequiredType(), null) {};
result.add(cmd);
}
return result;
}
public Collection<Command> tab(PlotPlayer player, String[] args, boolean space) {