mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 18:39:42 -05:00
SPIGOT-215: Implement infrastructure for Location tab completes
By: DemonWav <demonwav@gmail.com>
This commit is contained in:
1 parent
02b060f77a
commit
359e6edb63
3 files changed
+41
-2
No files matched your search
@@ -11,6 +11,7 @@ import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.defaults.*;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -161,6 +162,10 @@ public class SimpleCommandMap implements CommandMap {
|
||||
}
|
||||
|
||||
public List<String> tabComplete(CommandSender sender, String cmdLine) {
|
||||
return tabComplete(sender, cmdLine, null);
|
||||
}
|
||||
|
||||
public List<String> tabComplete(CommandSender sender, String cmdLine, Location location) {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
Validate.notNull(cmdLine, "Command line cannot null");
|
||||
|
||||
@@ -205,7 +210,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
String[] args = PATTERN_ON_SPACE.split(argLine, -1);
|
||||
|
||||
try {
|
||||
return target.tabComplete(sender, commandName, args);
|
||||
return target.tabComplete(sender, commandName, args, location);
|
||||
} catch (CommandException ex) {
|
||||
throw ex;
|
||||
} catch (Throwable ex) {
|
||||
|
||||
Reference in new issue
Block a user