Refactor confirmation

This commit is contained in:
Jesse Boyd
2019-11-21 06:50:37 +00:00
parent 444aa0dda7
commit 52a502a1c6
22 changed files with 782 additions and 575 deletions

View File

@ -341,19 +341,19 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command cmd, String commandLabel, String[] args) {
// Add the command to the array because the underlying command handling
// code of WorldEdit expects it
String[] split = new String[args.length + 1];
System.arraycopy(args, 0, split, 1, args.length);
split[0] = commandLabel;
String arguments = Joiner.on(" ").join(split);
CommandSuggestionEvent event = new CommandSuggestionEvent(wrapCommandSender(sender), arguments);
getWorldEdit().getEventBus().post(event);
return CommandUtil.fixSuggestions(arguments, event.getSuggestions());
}
// @Override
// public List<String> onTabComplete(CommandSender sender, Command cmd, String commandLabel, String[] args) {
// // Add the command to the array because the underlying command handling
// // code of WorldEdit expects it
// String[] split = new String[args.length + 1];
// System.arraycopy(args, 0, split, 1, args.length);
// split[0] = commandLabel;
//
// String arguments = Joiner.on(" ").join(split);
// CommandSuggestionEvent event = new CommandSuggestionEvent(wrapCommandSender(sender), arguments);
// getWorldEdit().getEventBus().post(event);
// return CommandUtil.fixSuggestions(arguments, event.getSuggestions());
// }
private void fail(Runnable run, String message) {
try {