mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
parent
740de4932b
commit
c7a1526e12
1 changed files with 4 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.plotsquared.sponge.util;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.intellectualcrafters.plot.commands.MainCommand;
|
||||
import com.intellectualcrafters.plot.object.ConsolePlayer;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
|
@ -47,7 +48,7 @@ public class SpongeCommand implements CommandCallable {
|
|||
public List<String> getSuggestions(CommandSource source, String arguments, Location<World> targetPosition)
|
||||
throws CommandException {
|
||||
if (!(source instanceof Player)) {
|
||||
return null;
|
||||
return ImmutableList.of();
|
||||
}
|
||||
PlotPlayer player = SpongeUtil.getPlayer((Player) source);
|
||||
String[] args = arguments.split(" ");
|
||||
|
@ -56,13 +57,13 @@ public class SpongeCommand implements CommandCallable {
|
|||
}
|
||||
Collection objects = MainCommand.getInstance().tab(player, args, arguments.endsWith(" "));
|
||||
if (objects == null) {
|
||||
return null;
|
||||
return ImmutableList.of();
|
||||
}
|
||||
List<String> result = new ArrayList<>();
|
||||
for (Object o : objects) {
|
||||
result.add(o.toString());
|
||||
}
|
||||
return result.isEmpty() ? null : result;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue